示例#1
0
文件: Pool.cs 项目: elleyer/tdg
        private void RemoveFromPool(Enemy enemy)
        {
            if (Enemies.Contains(enemy))
            {
                Enemies.Remove(enemy);
            }

            if (Enemies.Count <= 0)
            {
                AllEnemiesDestroyed?.Invoke();
            }
        }
示例#2
0
    //============================================================
    // Event Handlers:
    //============================================================

    private void Enemy_EnemyDestroyed()
    {
        // if we have more to spawn, spawn one after a delay
        if (enemiesToSpawnThisWave > 0)
        {
            SpawnEnemy(ENEMY_NEW_SPAWN_DELAY);
        }

        // otherwise, signal that all the enemies have been destroyed
        else
        {
            if (AllEnemiesDestroyed != null)
            {
                AllEnemiesDestroyed.Invoke();
            }
        }
    }