Beispiel #1
0
        private IEnumerator SpawnWaveCoroutine(EnemyAgent enemyPrefab, int enemies, float enemySpawnDelay)
        {
            for (int i = 0; i < enemies; i++)
            {
                yield return(new WaitForSeconds(enemySpawnDelay));

                SpawnEnemy(enemyPrefab, path);
            }
        }
Beispiel #2
0
        private void SpawnEnemy(EnemyAgent enemyPrefab, Transform path)
        {
            var enemy = enemyPool.Spawn(enemyPrefab, path.position, Quaternion.identity);

            enemy.LoadWaypoints(path);
        }
Beispiel #3
0
 public void SpawnWave(EnemyAgent enemyPrefab, int enemies, float enemySpawnDelay)
 {
     StartCoroutine(SpawnWaveCoroutine(enemyPrefab, enemies, enemySpawnDelay));
 }