void TileDie(MapSystem.Tile _tile) { TileDeathEvent tileDeathEventInfo = new TileDeathEvent(); tileDeathEventInfo.Description = "Actor " + gameObject.name + " has died."; tileDeathEventInfo.tile_go = gameObject; tileDeathEventInfo.FireEvent(); Destroy(gameObject); }
void OnDestroy() { PlayerDeathEvent.UnregisterListener(OnPlayerDeath); EnemyDeathEvent.UnregisterListener(OnEnemyDeath); TileDeathEvent.UnregisterListener(OnTileDeath); }
void OnTileDeath(TileDeathEvent tileDeath) { //Debug.Log("I hear " + tileDeath.tile_go.name + " has died - Report from the DeathListener"); }
// Use this for initialization void Start() { PlayerDeathEvent.RegisterListener(OnPlayerDeath); EnemyDeathEvent.RegisterListener(OnEnemyDeath); TileDeathEvent.RegisterListener(OnTileDeath); }