Exemplo n.º 1
0
 private void EnemyKilled(SpawnerDeathEventInfo udei)
 {
     if (udei.Killer.Equals(gameObject.name))
     {
         GetExp(udei.Level * 15);
     }
 }
Exemplo n.º 2
0
        public void TakeDamage(float f, string killer)
        {
            this.m_HP -= f;
            if (m_HP <= 0.0f)
            {
                for (int i = 0; i < mobsSpawned.Count; i++)
                {
                    if (mobsSpawned[i] != null)
                    {
                        mobsSpawned[i].Die();
                    }
                }
                Destroy(enemyArray.gameObject);

                SpawnerDeathEventInfo udei = new SpawnerDeathEventInfo();
                udei.EventDescription = "A spawner has been destroyed.";
                udei.Killer           = killer;
                udei.Level            = 5;
                EventSystem.Current.FireEvent(udei);
                Destroy(this.gameObject);
            }
        }