Esempio n. 1
0
 public void dmgRight(int dmg, MechTakeDamage hitbox)
 {
     rightHealth -= dmg;
     if (rightHealth < 0)
     {
         rightHealth = 0;
         hitbox.Exploding();
     }
     if (isPlayer)
     {
         healthbars[3].setHealthBar((float)rightHealth / (float)maxHealth);
     }
 }
Esempio n. 2
0
 public void dmgRear(int dmg, MechTakeDamage hitbox)
 {
     Debug.Log("Rear takes damage");
     rearHealth -= dmg;
     if (rearHealth < 0)
     {
         rearHealth = 0;
         hitbox.Exploding();
     }
     if (isPlayer)
     {
         healthbars[4].setHealthBar((float)rearHealth / (float)maxHealth);
     }
 }
Esempio n. 3
0
    public void dmgLeft(int dmg, MechTakeDamage hitbox)
    {
        Debug.Log("Left takes damage");
        leftHealth -= dmg;

        if (leftHealth < 0)
        {
            leftHealth = 0;
            hitbox.Exploding();
        }
        if (isPlayer)
        {
            healthbars[2].setHealthBar((float)leftHealth / (float)maxHealth);
        }
    }