public void TakeDamage(DamageTaker damagerTaker) { if ((invulnrable) || currentHealth <= 0) { return; } if (!invulnrable) { currentHealth -= damagerTaker.damage; onHealthSet.Invoke(this); } onTakeDamage.Invoke(damagerTaker, this); if (currentHealth <= 0) { onDie.Invoke(this); } }
public static void LogDamageEvent(DamageTaker damage, Damageable health) { Debug.Log("Damage Taken:" + health.gameObject.name + " takes " + damage.damage + " from " + damage.gameObject); }