diff --git a/302/Assets/Course Library/Anomalies/Anomaly27/clock_magnify.prefab b/302/Assets/Course Library/Anomalies/Anomaly27/clock_magnify.prefab index aeb3fd5..fa09349 100644 --- a/302/Assets/Course Library/Anomalies/Anomaly27/clock_magnify.prefab +++ b/302/Assets/Course Library/Anomalies/Anomaly27/clock_magnify.prefab @@ -116,7 +116,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4ff09b028cdd2394e82a6885f68c804d, type: 3} m_Name: m_EditorClassIdentifier: - scaleIncreaseRate: -10 + scaleIncreaseRate: -100 + scaleStartDelay: 5 --- !u!65 &-88205578807635617 BoxCollider: m_ObjectHideFlags: 0 diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27_magnifyingclock.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27_magnifyingclock.cs index 168621d..bc0ca91 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27_magnifyingclock.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27_magnifyingclock.cs @@ -4,6 +4,8 @@ public class Anomaly27_magnifyingclock : MonoBehaviour { [SerializeField] private float scaleIncreaseRate = 0.1f; // 초당 증가할 스케일 크기 + [SerializeField] private float scaleStartDelay = 5f; // 스케일 증가 시작 딜레이 + private bool isScaling = false; // 스케일 증가 여부 private bool isStageClear = true; private Collider objectCollider; @@ -13,13 +15,25 @@ void Start() isStageClear = true; objectCollider = GetComponent(); objectCollider.isTrigger = false; // Trigger 대신 물리 충돌로 처리 + + // 5초 후 스케일 증가 시작 + Invoke(nameof(StartScaling), scaleStartDelay); } void Update() { - // 시간에 따라 점점 오브젝트와 콜라이더의 스케일을 증가 - float scaleIncrease = scaleIncreaseRate * Time.deltaTime; - transform.localScale += new Vector3(scaleIncrease, scaleIncrease, scaleIncrease); + if (isScaling) + { + // 시간에 따라 점점 오브젝트와 콜라이더의 스케일을 증가 + float scaleIncrease = scaleIncreaseRate * Time.deltaTime; + transform.localScale += new Vector3(scaleIncrease, scaleIncrease, scaleIncrease); + } + } + + private void StartScaling() + { + isScaling = true; + Debug.Log("MagnifyingClock: Scaling has started after delay."); } private void OnCollisionEnter(Collision collision)