public void TakeDamage(float damage) { health -= damage; Debug.Log(health); if (health <= 0f) { spriteAnimator.AnimateDead(); } }
public void TakeDamage(float damage) { health -= damage; if (health <= 0f) { gameManager.AddScore(score); spriteAnimator.AnimateDead(); StartCoroutine(EnemyWaitDead(3)); Destroy(gameObject); } }
private void OnDisable() { m_Rigidbody2d.isKinematic = true; m_SpriteAnimator.AnimateDead(); }