몬스터 프리팹, 몬스터 스킬 프리팹 누락된 컴포넌트 추가 및 수정

This commit is contained in:
Mingu Kim
2025-02-15 19:28:24 +09:00
parent c2a0399a88
commit 33be5d2aa9
39 changed files with 1718 additions and 908 deletions

View File

@@ -9,19 +9,13 @@ namespace TON
[SerializeField]
private MonsterBase _monsterBase;
// private bool _isDetect;
private GameObject skill;
private GameObject skillPrefab;
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 MonsterSkillState());
// 플레이어 감지하면 따라가기
// _monsterBase.SetTransition(new ChasingState());
Debug.Log("감지됨");