예제 #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);
            }
        }
예제 #2
0
        private void SpawnEnemy(EnemyAgent enemyPrefab, Transform path)
        {
            var enemy = enemyPool.Spawn(enemyPrefab, path.position, Quaternion.identity);

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