Пример #1
0
 public void Hurt(float Amount, Vector3 PushDirection)
 {
     //Debug.Log(PushDirection);
     health -= Amount;
     OnScreenDisplay.PostMessage("Hit!", Color.yellow);
     rigidbody.AddForce(PushDirection * AttackKnockback);
     if (health <= 0)
     {
         Destroy(gameObject);
     }
 }
Пример #2
0
 public void Heal(int Amount)
 {
     OnScreenDisplay.SetHealthPoints(health + (int)Amount, false);
     OnScreenDisplay.PostMessage("Plus " + Amount + " health!", Color.green);
     if (health + Amount > 100)
     {
         health = 100;
     }
     else
     {
         audio.PlayOneShot(powerUp);
         health += Amount;
     }
 }
Пример #3
0
 public void Harm(int damage)
 {
     FlashLight.Injury();
     health -= damage;
     OnScreenDisplay.SetHealthPoints((int)health, false);
     //Debug.Log (health);
     if (health <= 0)
     {
         Die();
     }
     else
     {
         audio.Play();
         OnScreenDisplay.PostMessage("Taking Damage!", Color.red);
     }
 }