Пример #1
0
        public void EnemyDie()
        {
            EnemyDeathEvent enemyDeathEventInfo = new EnemyDeathEvent();

            enemyDeathEventInfo.Description = "Actor " + gameObject.name + " has died.";
            enemyDeathEventInfo.enemy_go    = gameObject;
            enemyDeathEventInfo.FireEvent();

            Destroy(gameObject);
        }
Пример #2
0
 void OnDestroy()
 {
     PlayerDeathEvent.UnregisterListener(OnPlayerDeath);
     EnemyDeathEvent.UnregisterListener(OnEnemyDeath);
     TileDeathEvent.UnregisterListener(OnTileDeath);
 }
Пример #3
0
 void OnEnemyDeath(EnemyDeathEvent enemyDeath)
 {
     //When the enemy dies a new crystal is spawned
     Instantiate(CrystalToSpawn, enemyDeath.enemy_go.transform.position, Quaternion.identity);
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     PlayerDeathEvent.RegisterListener(OnPlayerDeath);
     EnemyDeathEvent.RegisterListener(OnEnemyDeath);
     TileDeathEvent.RegisterListener(OnTileDeath);
 }