private IEnumerator spawnEnemiesInWave(WaveConfiguration wave)
 {
     for (int enemyCount = 0; enemyCount < wave.getNumberOfEnemies(); enemyCount++)
     {
         var newEnemy = Instantiate(
             wave.getEnemyPreab(),
             wave.getWaypoints()[0].transform.position,
             Quaternion.identity);
         newEnemy.GetComponent <EnemyMovement>().setWaveConfig(wave);
         yield return(new WaitForSeconds(wave.getTimeBetweenSpawns()));
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     waypoints          = waveConfig.getWaypoints();
     transform.position = waypoints[waypointIndex].transform.position;
 }