29 lines
823 B
C#
29 lines
823 B
C#
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
public class BossZoneTrigger : MonoBehaviour
|
|||
|
|
{
|
|||
|
|
[SerializeField] private NorcielBoss boss; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
[SerializeField] private GameObject fogWall; // <20><><EFBFBD><EFBFBD> <20><> <20>Ա<EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ȱ<EFBFBD> (<28><><EFBFBD><EFBFBD>)
|
|||
|
|
|
|||
|
|
private bool hasTriggered = false;
|
|||
|
|
|
|||
|
|
private void OnTriggerEnter(Collider other)
|
|||
|
|
{
|
|||
|
|
// <20>̹<EFBFBD> <20>ߵ<EFBFBD><DFB5>߰ų<DFB0>, <20>÷<EFBFBD><C3B7>̾ <20>ƴϸ<C6B4> <20><><EFBFBD><EFBFBD>
|
|||
|
|
if (hasTriggered) return;
|
|||
|
|
|
|||
|
|
if (other.CompareTag("Player"))
|
|||
|
|
{
|
|||
|
|
hasTriggered = true;
|
|||
|
|
|
|||
|
|
// 1. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if (boss != null) boss.StartBossBattle();
|
|||
|
|
|
|||
|
|
// 2. <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>Ա<EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>)
|
|||
|
|
if (fogWall != null) fogWall.SetActive(true);
|
|||
|
|
|
|||
|
|
// 3. <20><> Ʈ<><C6AE><EFBFBD>Ŵ<EFBFBD> <20><> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
// gameObject.SetActive(false); // <20>ٷ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ȱ<EFBFBD><C8B0><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|