using UnityEngine; // 유니티 기능을 불러올거에요 -> UnityEngine을 public class BossZoneTrigger : MonoBehaviour // 클래스를 선언할거에요 -> 보스방 입장 트리거를 { [SerializeField] private NorcielBoss boss; // 변수를 선언할거에요 -> 보스 참조를 [SerializeField] private GameObject entranceWall; // 변수를 선언할거에요 -> 입구 막는 벽을 private bool isTriggered = false; // 변수를 선언할거에요 -> 이미 발동했는지를 private void OnTriggerEnter(Collider other) // 함수를 실행할거에요 -> 충돌 감지를 { if (isTriggered) return; // 중단할거에요 -> 이미 발동했으면 if (other.CompareTag("Player")) // 조건이 맞으면 실행할거에요 -> 플레이어가 들어오면 { isTriggered = true; // 설정할거에요 -> 발동됨으로 if (entranceWall != null) entranceWall.SetActive(true); // 켤거에요 -> 벽을 (못 나가게) if (boss != null) // 조건이 맞으면 실행할거에요 -> 보스가 연결돼있으면 { boss.StartBossBattle(); // 실행할거에요 -> 보스전 시작을 } Debug.Log("⚔️ 보스전 시작! 퇴로는 없다."); // 로그를 찍을거에요 -> 시작 알림을 } } }