private IEnumerator SpawAllEnemiesInWave(waveConfig waveConfig)
    {
        for (int enemyIndex = 0; enemyIndex < waveConfig.GetNumberOfEnemies(); enemyIndex++)
        {
            var newEnemy = Instantiate(waveConfig.GetEnemyPrefab(), waveConfig.GetPathWayPoints()[0].transform.position, Quaternion.identity);

            newEnemy.GetComponent <enemyPath>().SetWaveConfig(waveConfig);

            yield return(new WaitForSeconds(waveConfig.GetTimeBetweenSpawns()));
        }
    }
Beispiel #2
0
 // Start is called before the first frame update
 void Start()
 {
     enemyWayPonits     = waveConf.GetPathWayPoints();
     transform.position = enemyWayPonits[wayPointIndex].transform.position;
 }