Ejemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     wayPoints = waveConfig.GetEnemyWayPoints();
     transform.position = wayPoints[wayPointIndex].transform.position;
     
     
 }
Ejemplo n.º 2
0
 private IEnumerator SpawnAllEnemyInWave(WaveConfig waveConfig)
 {
     for (int enemyCount = 0; enemyCount < waveConfig.GetNumberOfEnemies(); enemyCount++)
     {
         var newEnemy = Instantiate(waveConfig.GetEnemyPrefab(),
                                    waveConfig.GetEnemyWayPoints()[0].transform.position,
                                    Quaternion.identity);
         newEnemy.GetComponent <EnemyPathing>().SetWaveConfig(waveConfig);
         yield return(new WaitForSeconds(waveConfig.GetTimeBetweenSpawn()));
     }
 }