public override void TakeDamage(int damage) { base.TakeDamage(damage); //Update health bar UI. healthStatUI.SetValue(currentHealth); }
void OnEquipmentChanged(Equipment newItem, Equipment oldItem) { if (newItem != null) { protection.AddModifier(newItem.armorModifier); strength.AddModifier(newItem.damageModifier); } if (oldItem != null) { protection.RemoveModifier(oldItem.armorModifier); strength.RemoveModifier(oldItem.damageModifier); } //Update protection and strength UI. protectionStatUI.SetValue(protection.GetValue()); strengthStatUI.SetValue(strength.GetValue()); }