Example #1
0
    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);
    }
Example #2
0
 public void FullMeterFinished()
 {
     isAnimating = false;
     UpdateVisual();
     lootManager.SpawnLoot();
 }