diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs index 033d54e..57dfa32 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs @@ -42,14 +42,10 @@ public override bool ResetAnomaly() return res; } + private void Start() { - // 상호작용할 수 있는 투명한 큐브 - interactionCube = CreateInteractionCube(); - StartCoroutine(SetTransparency(interactionCube)); - - // 거미 생성 - StartCoroutine(SpawnSpiderRoutine()); + StartAnomaly(); } public void StopSpawning() diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs index 6e3eb47..55fd2cf 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs @@ -12,6 +12,11 @@ public class Anomaly15_spider : AbstractAnomalyInteractable private Transform cameraTransform; private AudioSource audioSource; + private void Start() + { + StartAnomaly(); + } + public override bool StartAnomaly() { bool res = base.StartAnomaly(); @@ -22,7 +27,10 @@ public override bool StartAnomaly() audioSource = gameObject.AddComponent(); audioSource.clip = spiderSoundClip; audioSource.loop = true; - audioSource.spatialBlend = 2f; // 3D 음향으로 설정 + audioSource.spatialBlend = 1.0f; // 3D 음향으로 설정 + audioSource.minDistance = 1.0f; + audioSource.maxDistance = 10.0f; + audioSource.Play(); return res; @@ -34,26 +42,29 @@ public override bool ResetAnomaly() bool res = base.ResetAnomaly(); audioSource.Stop(); - if (anomalyManager != null) - { - anomalyManager.StopSpawning(); - } - StartCoroutine(DelayedDestroy()); return res; } - public override virtual OnInteract() + public override void OnInteract() { base.OnInteract(); GameManager.Instance.SetStageClear(); + + ResetAnomaly(); + anomalyManager.ResetAnomaly(); + } + + public override bool CanInteract(float distance) + { + if (distance < 5.0f) return true; + else return false; } private IEnumerator DelayedDestroy() { yield return new WaitForSeconds(2f); // Wait for 2 seconds Destroy(gameObject); // Destroy this spider object - GameManager.Instance.SetStageClear(); // Mark the stage as clear } } diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly16_marker.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly16_marker.cs index c64a8f0..ea8ec23 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly16_marker.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly16_marker.cs @@ -62,6 +62,8 @@ public override bool StartAnomaly() // Start the drawing coroutine with a delay StartCoroutine(StartDrawingWithDelay()); + + return true; } public override bool ResetAnomaly() @@ -71,9 +73,10 @@ public override bool ResetAnomaly() anomalyManager.DestroyMarkerLineWithSound(); audioSource.Stop(); } + return true; } - public override virtual OnInteract() + public override void OnInteract() { base.OnInteract(); GameManager.Instance.SetStageClear();