private void Die() { if (isDead) { return; } isDead = true; animator.SetTrigger("die"); actionScheduler.CancelCurrentAction(); }
private void Die() { if (isDead) { return; } GetComponent <Animator>().SetTrigger("Die"); isDead = true; scheduler.CancelCurrentAction(); if (GetComponent <NavMeshAgent>() != null) { GetComponent <NavMeshAgent>().enabled = false; } }
public void TakeDamage(float damageDone) { if (isDead) { return; } healthPoints = Mathf.Max(healthPoints - damageDone, 0); if (healthPoints == 0) { // trigger death anim isDead = true; animator.SetTrigger("die"); actionScheduler.CancelCurrentAction(); } }
private void Die() { isDead = true; animator.SetTrigger("death"); actionScheduler.CancelCurrentAction(); }
private void Die() { isDead = true; GetComponent <Animator>().SetTrigger("die"); _actionScheduler.CancelCurrentAction(); }