スタン状態追加

This commit is contained in:
KawakamiKento
2026-06-03 16:35:15 +09:00
parent 6aaaca800b
commit 69f5891a14
7 changed files with 369 additions and 44 deletions

View File

@@ -9,6 +9,8 @@ public class EnemyHealth : MonoBehaviour, IDamageble
[SerializeField] private float knockbackDuration = 0.5f;
private EnemyAI enemyAI;
private bool isDead = false;
void Start()
{
currentHealth = maxHealth; //HPを代入
@@ -41,11 +43,26 @@ public class EnemyHealth : MonoBehaviour, IDamageble
private void Die()
{
if(isDead) return;
isDead = true;
Animator anim = GetComponent<Animator>();
if(anim != null)
{
anim.SetTrigger("Dead");
}
Collider col = GetComponent<Collider>();
if(col != null)
{
col.enabled = false;
}
if(enemyAI != null)
{
enemyAI.DisableAIOnDeath();
}
Destroy(gameObject, 0.5f);
Destroy(gameObject, 3.0f);
}
}