public int GetSectionHealth(int section) { RocketSectionHealth rsh = sections[section]; if (rsh != null) { return(rsh.currentHealth); } return(-1); }
public void SetSectionHealth(int section, int health) { RocketSectionHealth rsh = sections[section]; if (rsh != null) { rsh.currentHealth = health; sectionImages[section].color = healthGradient.Evaluate(((float)rsh.currentHealth) / rsh.maxHealth); } }
public int RemoveSectionHealth(int section, int healthToRemove) { RocketSectionHealth rsh = sections[section]; if (rsh != null) { rsh.currentHealth -= healthToRemove; sectionImages[section].color = healthGradient.Evaluate(((float)rsh.currentHealth) / rsh.maxHealth); return(rsh.currentHealth); } return(-1); }
public void ShowHealth(int section) { RocketSectionHealth rsh = sections[section]; sectionImages[section].color = healthGradient.Evaluate(((float)rsh.currentHealth) / rsh.maxHealth); }