몬스터 Hit, Death 상태 틀 추가

This commit is contained in:
Mingu Kim
2025-02-19 00:44:53 +09:00
parent 4d0a7de68a
commit ae5913ec0b
4 changed files with 91 additions and 10 deletions

View File

@@ -36,6 +36,8 @@ namespace TON
public bool IsDetect { get; set; } // 몬스터가 대상을 인식했는지 여부
public bool IsAttacking { get; set; } // 몬스터가 공격했는지 여부
public bool IsFisnishAttack { get; set; } // 몬스터 공격 모션이 끝났는지 여부
public bool IsHit { get; set; } // 몬스터 공격 모션이 끝났는지 여부
public bool IsDead { get; set; } // 몬스터 공격 모션이 끝났는지 여부
[SerializeField] private GameObject _target; // 몬스터의 타겟
@@ -162,7 +164,8 @@ namespace TON
if (prevHP > 0 && currentHP <= 0)
{
// 몬스터가 죽었을 때 처리 (죽는 애니메이션은 주석 처리됨)
Destroy(gameObject); // 몬스터 파괴
// Destroy(gameObject); // 몬스터 파괴
DestroyMonster();
}
else if (prevHP > 0 && currentHP > 0)
{
@@ -248,5 +251,10 @@ namespace TON
newSkill.transform.position = transform.position + new Vector3(0, 1f, 0);
newSkill.GetComponent<MonsterSkill>().Direction = new Vector2(0, 1);
}
public void DestroyMonster()
{
Destroy(gameObject); // 몬스터 파괴
}
}
}
}