diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs similarity index 86% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Manager.cs rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs index 4adc442..033d54e 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Manager.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs @@ -1,8 +1,11 @@ using UnityEngine; using System.Collections; -public class Anomaly15Manager : MonoBehaviour + +public class Anomaly15Controller : AbstractAnomalyObject { + public override string Name { get; } = "Anomaly15Controller"; + [Header("Spider Settings")] public GameObject spiderPrefab; private float spawnRadius = 0.5f; @@ -10,25 +13,43 @@ public class Anomaly15Manager : MonoBehaviour private float moveSpeed = 1f; private float fadeDistance = 2f; private Vector3 basePosition = new Vector3(6.9f, 7.7f, -7.1f); - public bool isSpawningSpiders = true; private GameObject interactionCube; [Header("Audio Settings")] public AudioClip spiderSoundClip; - private void Start() + public override bool StartAnomaly() { + bool res = base.StartAnomaly(); + // 상호작용할 수 있는 투명한 큐브 interactionCube = CreateInteractionCube(); StartCoroutine(SetTransparency(interactionCube)); // 거미 생성 + isSpawningSpiders = true; StartCoroutine(SpawnSpiderRoutine()); + + return res; } - private void OnEnable() + // 이상현상을 초기화하는 메서드 + public override bool ResetAnomaly() { - isSpawningSpiders = true; + bool res = base.ResetAnomaly(); + + StopSpawning(); + + return res; + } + private void Start() + { + // 상호작용할 수 있는 투명한 큐브 + interactionCube = CreateInteractionCube(); + StartCoroutine(SetTransparency(interactionCube)); + + // 거미 생성 + StartCoroutine(SpawnSpiderRoutine()); } public void StopSpawning() diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly15Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs index cb7172e..31588c5 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs @@ -6,7 +6,7 @@ public class Anomaly15_spider : InteractableObject, IInteractable [Header("Interaction Settings")] private bool hasInteracted = false; - private Anomaly15Manager anomalyManager; + private Anomaly15Controller anomalyManager; [Header("Audio Settings")] public AudioClip spiderSoundClip; private Transform cameraTransform; @@ -14,7 +14,7 @@ public class Anomaly15_spider : InteractableObject, IInteractable private void Start() { - anomalyManager = FindObjectOfType(); + anomalyManager = FindObjectOfType(); GameObject mainCamera = GameObject.FindWithTag("MainCamera"); audioSource = gameObject.AddComponent(); @@ -50,7 +50,7 @@ public void OnInteract() hasInteracted = true; - // Call StopSpawning on Anomaly15Manager and start the delayed destroy + // Call StopSpawning on Anomaly15Controller and start the delayed destroy if (anomalyManager != null) { anomalyManager.StopSpawning();