public void TakeDamage(ICombatAggressor aggressor)
 {
     animatorController.OnTakeDamage();
     Health.RemovePoints(aggressor.GetDamage().value);
     if (Health.CurrentPoints == 0)
     {
         animatorController.OnDie();
         var parent = transform.parent;
         parent.GetComponent <NpcMainScript>().enabled            = false;
         parent.GetComponent <NavMeshAgent>().enabled             = false;
         parent.GetChild(0).GetComponent <MeshCollider>().enabled = false;
     }
 }
Esempio n. 2
0
 public void TakeDamage(ICombatAggressor aggressor)
 {
     animatorController.OnTakeDamage();
     StartCoroutine(DoTakeDamage(aggressor));
 }