// Coroutine that handles spawning enemies.
 IEnumerator SpawnEnemiesInWave(WaveConfig waveConfig)
 {
     for (int enemyCount = 0; enemyCount < waveConfig.GetAmountOfEnemies(); enemyCount++)
     {
         // TODO: Instantiate new enemies as a child of a enemy group.
         // Instantiates a new enemy based on information given by wave config, including prefab and position.
         GameObject newEnemy = Instantiate(waveConfig.GetEnemyPrefab(), waveConfig.GetWaypoints()[0].transform.position, Quaternion.identity);
         newEnemy.GetComponent <EnemyPathing>().SetWaveConfig(waveConfig);    // Assigns path to new enemy.
         yield return(new WaitForSeconds(waveConfig.GetTimeBetweenSpawns())); // Yields to wait before next spawn based on info from wave config.
     }
 }