몬스터 스킬 코드 추가

This commit is contained in:
Mingu Kim
2025-02-15 16:13:46 +09:00
parent 648452a153
commit 5d142c6652
12 changed files with 567 additions and 103 deletions

View File

@@ -9,14 +9,21 @@ namespace TON
[SerializeField]
private MonsterBase _monsterBase;
// private bool _isDetect;
private GameObject skill;
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
skill = _monsterBase.smallFirePrefab;
GameObject newSkill = Instantiate<GameObject>(skill);
newSkill.transform.position = other.transform.position;
// newSkill.GetComponent<skill>().Direction = new Vector2(1, 0);
// _monsterBase.SetTransition(new AttackState());
// 플레이어 감지하면 따라가기
_monsterBase.SetTransition(new ChasingState());
// _monsterBase.SetTransition(new ChasingState());
Debug.Log("감지됨");
}