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); } }
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); } }
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); } }