void HandleRestoreHealth(GameObject obj) { Damageable dam = obj.GetComponent <Damageable>(); if (dam) { dam.SetHealth(dam.GetMaxHealth()); } else { Debug.Log(obj.name + " is trying to restore health but doesn't have a damageable component"); } }
protected override void Update() { if (player) { Damageable dam = player.GetComponent <Damageable>(); if (dam) { UpdateIcons(dam.GetHealth(), dam.GetMaxHealth()); } } else { base.Update(); } }