Example #1
0
        void PlayerDie()
        {
            PlayerDeathEvent playerDeathEventInfo = new PlayerDeathEvent();

            playerDeathEventInfo.Description = "Actor " + gameObject.name + " has died.";
            playerDeathEventInfo.player_go   = gameObject;
            playerDeathEventInfo.FireEvent();

            Destroy(gameObject);
        }
Example #2
0
 void OnDestroy()
 {
     PlayerDeathEvent.UnregisterListener(OnPlayerDeath);
     EnemyDeathEvent.UnregisterListener(OnEnemyDeath);
     TileDeathEvent.UnregisterListener(OnTileDeath);
 }
Example #3
0
 void OnPlayerDeath(PlayerDeathEvent playerDeath)
 {
     //Debug.Log("I hear " + playerDeath.player_go.name + " has died - Report from the DeathListener");
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     PlayerDeathEvent.RegisterListener(OnPlayerDeath);
     EnemyDeathEvent.RegisterListener(OnEnemyDeath);
     TileDeathEvent.RegisterListener(OnTileDeath);
 }