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()));
     }
 }