コード例 #1
0
 private void Die()
 {
     if (isDead)
     {
         return;
     }
     isDead = true;
     animator.SetTrigger("die");
     actionScheduler.CancelCurrentAction();
 }
コード例 #2
0
 private void Die()
 {
     if (isDead)
     {
         return;
     }
     GetComponent <Animator>().SetTrigger("Die");
     isDead = true;
     scheduler.CancelCurrentAction();
     if (GetComponent <NavMeshAgent>() != null)
     {
         GetComponent <NavMeshAgent>().enabled = false;
     }
 }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
ファイル: Health.cs プロジェクト: JordanMMarsh/Top-down-RPG
 private void Die()
 {
     isDead = true;
     animator.SetTrigger("death");
     actionScheduler.CancelCurrentAction();
 }
コード例 #5
0
 private void Die()
 {
     isDead = true;
     GetComponent <Animator>().SetTrigger("die");
     _actionScheduler.CancelCurrentAction();
 }