void OnChangeHealth(int health) { if (healthBar != null) { healthBar.setPercent(health, maxHealth); } if (healthChange != null) { healthChange(health); } }
void updateBar(int newHealth) { healthBar.setPercent(newHealth, health.maxHealth); }