public void DamageFence(int damageAmount) { bool _isDead = health <= 0; if (_isDead) { return; } if (!child0.activeSelf) { child0.SetActive(true); } popUpController.PlayPopUpAnime(damageAmount.ToString()); ModifyHealth(damageAmount); if (health <= 0) { //die DestroyFence(); } }
public void DamageEnemy(int damage) { bool _isDead = health <= 0; if (_isDead) { return; } popUpController.PlayPopUpAnime(damage.ToString()); ModifyHealth(damage); PlayerManager.instance.PLAY_APPROPRIATE_COMBO(damage); Debug.Log("current health : " + health); if (health <= 0) { isDead = true; if (!controller.CAN_PLAY_ANIME()) { anime.SetTrigger("dead"); Debug.Log("SET TRIGGER DEAD!"); } //die Die(); } else { if (!controller.CAN_PLAY_ANIME()) { Debug.Log("SET TRIGGER TAKE DAMAGE!!"); anime.SetTrigger("takeDamage"); } } }