void HandleDamage(GameObject obj, int amount) { Damageable dam = obj.GetComponent <Damageable>(); if (obj.gameObject.name == "Player") { app.NotifyAnimation(AnimationMessage.TRIGGER, obj, "damage"); } if (dam) { dam.ChangeHealth(-amount); } else { Debug.Log(obj.name + " was scheduled for damage calculations but doesn't have a damageable component."); } }
void HandleHeal(GameObject obj) { Damageable heal = obj.GetComponent <Damageable>(); heal.SetHealth(3); }