示例#1
0
        void TileDie(MapSystem.Tile _tile)
        {
            TileDeathEvent tileDeathEventInfo = new TileDeathEvent();

            tileDeathEventInfo.Description = "Actor " + gameObject.name + " has died.";
            tileDeathEventInfo.tile_go     = gameObject;
            tileDeathEventInfo.FireEvent();

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