Beispiel #1
0
        private IEnumerator Spawn()
        {
            while (true)
            {
                spawner.SpawnEnemy(gameAssets.EnemyUnits[0], EnemySpawnPosition.position);
                yield return(new WaitForSeconds(10));

                spawner.SpawnEnemy(gameAssets.EnemyUnits[1], EnemySpawnPosition.position);
                yield return(new WaitForSeconds(10));
            }
        }
Beispiel #2
0
        /////////////////////////////////////////////
        bool SpawnEnemy(GameObject enemyToInstantiate)
        {
            Enemy enemy = enemySpawner.SpawnEnemy(enemyToInstantiate);

            if (enemy == null)
            {
                Debug.LogWarning("MonsterManager: Failed to spawn enemy");
                return(false);
            }
            enemy.RegisterDieAction(DestroyEnemy);
            mEnemyList.Add(enemy);
            return(true);
        }