Beispiel #1
0
 public void isDead(HealthItem hitType)
 {
     if (human)
     {
         human.KillMe(( int )hitType.hitType);
         human.updateAnimator();
     }
 }
        /// <summary>
        ///     Alter our total health
        ///     with the amount of damage to do. A negetive
        ///     number will do negetive damager, so plus health
        /// </summary>
        /// <param name="amount">Amount.</param>
        public void alterHealth(float amount, HealthItem item)
        {
            if (CurrentHealth <= 0.0f)
            {
                return;
            }

            if (!Invincible)
            {
                amount        = amount * -1;
                LastHitDamage = amount;
                CurrentHealth = Mathf.Clamp(value: CurrentHealth + amount, min: 0, max: totalHealth);
            }

            // Objects
            _lastHealthItem = item;

            DoHitActions(amount);
        }
 public void isDead(HealthItem hitType)
 {
     killedAtPoint = hitType;
     CreateRagdoll();
 }