Beispiel #1
0
    public void Hit(float amount, bool isStunned = false)
    {
        stats.DecreaseHP(amount);
        rb.velocity              = -rb.velocity;
        HitCollider.isTrigger    = false;
        NormalCollider.isTrigger = true;
        StartCoroutine(ResumeCollider());
        framesSinceLastMovement = -100;

        if (!isStunned)
        {
            if (stats.GetHP() <= 0)
            {
                Die();
            }
            else
            {
                animationManager.AddToQueue("Hit");
            }
        }
        else
        {
            animationManager.AddToQueue("Stunned");
        }
    }
Beispiel #2
0
 public void Hit(float amount)
 {
     stats.DecreaseHP(amount);
     if (stats.GetHP() <= 0)
     {
         Die();
     }
 }
 public void Hit(float amount, bool isStunned = false)
 {
     stunned     = true;
     rb.velocity = -rb.velocity;
     stats.DecreaseHP(amount);
     if (!isStunned)
     {
         if (stats.GetHP() <= 0)
         {
             anim.AddToQueue("Dead");
             StartCoroutine(Defeated());
         }
         else
         {
             anim.AddToQueue("Hit");
         }
     }
     else
     {
         anim.AddToQueue("Stunned");
     }
 }