I decided to get fancy with the health bars. Just like you see in other games, as the health passes below certain thresholds the color changes from Green (healthy) to Yellow (damaged) to Red (critical). While typing this I realized I should make the thresholds as serilizedfields and then it can be set from the editor. Changes to be made after the post.
private void HandleHealthChanged(int oldHealth, int newHealth) {
float fillAmount = (float) newHealth / health.MaxHealth;
healthBarImage.fillAmount = fillAmount;if (fillAmount > 0.6f) { healthBarImage.color = new Color32(10,130,10,255);} else if (fillAmount < 0.2f) { healthBarImage.color = new Color32(180,20,10,255);} else { healthBarImage.color = new Color32(190,170,10,255);} }