// We simply check to see if this Ai is invincible, if so then the lifestate is set to IsInvincible. // Otherwise check to see if the Health is equal or lower to 0 before setting to IsDead state. private void Ai_LifeState( ) { if (_IsInvincible) { lifeState = LIFE_STATE.IsInvincible; } else { if (Health <= 0.0f) { lifeState = LIFE_STATE.IsDead; } } }
// We simply check to see if this Ai is invincible, if so then the lifestate is set to IsInvincible. // Otherwise check to see if the Health is equal or lower to 0 before setting to IsDead state. private void Ai_LifeState() { if (_IsInvincible) { lifeState = LIFE_STATE.IsInvincible; } else { if (Health <= 0.0f) { lifeState = LIFE_STATE.IsDead; anim.SetBool("Dead", true); Destroy(this.gameObject, 2.0f); } } }