Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

이상현상 15 AbstractAnomalyObject 상속으로 변경 #187

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,34 +1,55 @@
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;
private float spawnInterval = 0.3f;
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()
Expand Down
6 changes: 3 additions & 3 deletions 302/Assets/Scripts/SpecificAnomalyManager/Anomaly15_spider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ 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;
private AudioSource audioSource;

private void Start()
{
anomalyManager = FindObjectOfType<Anomaly15Manager>();
anomalyManager = FindObjectOfType<Anomaly15Controller>();
GameObject mainCamera = GameObject.FindWithTag("MainCamera");

audioSource = gameObject.AddComponent<AudioSource>();
Expand Down Expand Up @@ -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();
Expand Down
Loading