// Start is called before the first frame update void Start() { wayPoints = waveConfig.GetEnemyWayPoints(); transform.position = wayPoints[wayPointIndex].transform.position; }
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())); } }