Exemplo n.º 1
0
 // manage the missile's movement and destruction
 protected virtual void Update()
 {
     if (!Move())
     {
         GameEventSignals.DoMissileExplode(this, prefabExplosion.GetComponent <Explosion>());
     }
 }
Exemplo n.º 2
0
 // apply damage to all damageable game entities that are within the bounds of the explosion
 void OnTriggerEnter(Collider _other)
 {
     if (_other.CompareTag("EnemyMissile"))
     {
         GameEventSignals.DoMissileExplode(_other.GetComponent <EnemyMissile>(), this);
     }
     else if (_other.CompareTag("CounterMissile"))
     {
         GameEventSignals.DoMissileExplode(_other.GetComponent <CounterMissile>(), this);
     }
     else if (_other.CompareTag("Cannon"))
     {
         GameEventSignals.DoEntityDamaged(_other.GetComponent <Cannon>());
     }
 }
Exemplo n.º 3
0
    void OnEnemySwitchDirCountUpdated(int _switchDirCount, GameObject _enemy)
    {
        foreach (var elem in switchDirLevelsMap)
        {
            if (elem.Key == _enemy)
            {
                ClearSwitchDirLevels(elem);
                CreateSwitchDirLevels(_switchDirCount, elem);

                lockOn = true;
                for (int i = 0; i < enemies.Count; ++i)
                {
                    GameEventSignals.DoMissileExplode(enemies.Dequeue(), null);
                }
                lockOn = false;
            }
        }
    }