No need to set initial position in EnemySpawner

Since the initial position is already set in the Start() method of Pathfinder, it is not necessary to set it again in EnemySpawner.
Here is an optimized version:

    void SpawnEnemies()
    {
        for (int i = 0; i < currentWave.GetEnemyCount(); i++)
        {
            Instantiate(currentWave.GetEnemyPrefab(i), transform);
        }
    }

Privacy & Terms