From ea81d7bb12aad3e25d788576d35a9d3ce370dd55 Mon Sep 17 00:00:00 2001 From: seozzi Date: Sat, 14 Dec 2024 22:00:18 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=83=81=ED=98=84=EC=83=81=2015=20ref?= =?UTF-8?q?actoring=20=ED=9B=84=20=EC=A0=95=EC=83=81=20=EC=9E=91=EB=8F=99?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Anomaly15Controller.cs | 8 ++---- .../Anomaly15_spider.cs | 27 +++++++++++++------ .../Anomaly16_marker.cs | 5 +++- 3 files changed, 25 insertions(+), 15 deletions(-) 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();