Esempio n. 1
0
        public void EnemyDie()
        {
            EnemyDeathEvent enemyDeathEventInfo = new EnemyDeathEvent();

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

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