Example #1
0
 protected void LoseHealth(float damage, bool display)
 {
     EnableEnemyStateUI();
     EnemyHealth.LoseHealth(damage, display);
     if (IsDead && EnemyState.MovementState != CharacterMovementState.Dead)
     {
         Data.IsAlive      = false;
         Data.BodyPosition = transform.position;
         if (DeadSignal)
         {
             DeadSignal.Raise();
         }
         if (RoomSignal != null)
         {
             RoomSignal.Raise();
         }
         GetLoot();
         if (DeathAnimation != null)
         {
             StartCoroutine(DeathAnimationAndDestroy());
         }
         else
         {
             StartCoroutine(DieAndLeaveBody());
         }
     }
 }
Example #2
0
 private IEnumerator Death()
 {
     ChangeState(MinotaurState.Dead);
     animator.SetTrigger("Die");
     triggerCollider.enabled = false;
     DeadSignal.Raise();
     body.isKinematic = true;
     GetComponent <KnockBack>().IsActive = false;
     yield return(null);
 }