protected virtual void Die(Entity cause = null) { ShowDeathEffect(); GameManager.UnregisterEntity(owner); owner.UnregisterListeners(); //Debug.Log(owner.gameObject + " has died"); if(owner.gameObject.tag == "Player") { GameManager.ReturnToMainMenu(); return; } if(lootManager != null) { lootManager.SpawnLoot(); } EventData data = new EventData(); data.AddMonoBehaviour("Target", owner); data.AddMonoBehaviour("Cause", cause); EventGrid.EventManager.SendEvent(Constants.GameEvent.EntityDied, data); Destroy(owner.gameObject); }
public void FullMeterFinished() { isAnimating = false; UpdateVisual(); lootManager.SpawnLoot(); }