Esempio n. 1
0
 // This function should be called by whoever deals damage to the barricade
 public void receiveDamage(int amount)
 {
     UI.S.PlaySound("Hit");
     health -= amount;
     HitText.Create(this.transform.position, amount);
     checkHealth();
 }
Esempio n. 2
0
 public void receiveDamage(int amount)
 {
     this.Health -= amount;
     HitText.Create(this.transform.position, amount);
     if (Health <= 0)
     {
         Destroy(this.gameObject);
     }
 }
Esempio n. 3
0
 public void receiveDamage(int amount)
 {
     if (type == UnitType.Balloon)
     {
         UI.S.PlaySound("FlyingHurt");
     }
     else if (type == UnitType.Archer)
     {
         UI.S.PlaySound("FemaleHurt");
     }
     else
     {
         UI.S.PlaySound("MaleHurt");
     }
     this.health -= amount;
     HitText.Create(this.transform.position, amount);
     if (this.health <= 0)
     {
         //Death
         Destroy(this.gameObject);
     }
 }