public void OnPlayerDeath(GameObject ObjectThatKilledPlayer) { if (PlayerIsDead != null) { PlayerIsDead(ObjectThatKilledPlayer); print(string.Format("OnPlayerDeath has triggered {0} event call(s)", PlayerIsDead.GetInvocationList().Length)); } else { print(string.Format("OnPlayerDeath has triggered no event calls. Player Died by {0} at location {1}", ObjectThatKilledPlayer.name, ObjectThatKilledPlayer.transform.position)); } }
private void Die() { animator.Play("Die"); PlayerIsDead.Invoke(); }