Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Doubt with the tower defense video unlocking levels

hello in the Wave spawner script brackeys put EnemiesAlive = wave.count but i found a way to put multiple enemies in one wave here is the code if you want it

//WaveSpawner Class

IEnumerator SpawnWave()


{


PlayerInfo.Rounds++;




Wave wave = waves[waveIndex];


for (int z = 0; z < wave.enemies.Length; z++)


{


for (int i = 0; i < wave.enemies[z].count; i++)


{


SpawnEnemy(wave.enemies[z].enemy);


yield return new WaitForSeconds(1f / wave.spawnRate);


}


if (waveIndex == waves.Length)


{


Debug.Log("TODO - End Level");


this.enabled = false;


}


}


waveIndex++;


}

//Wave Class

[System.Serializable]


public class Wave


{


public float spawnRate;


public WaveGroup[] enemies;


[System.Serializable]


public class WaveGroup


{


public GameObject enemy;


public int count;


}


}


And i cant set Enemies alive = wave.count

Any way to fix this i tried everything i thought of but i cant pls professionals

HELP ME!!!!!!

Answers

Sign In or Register to comment.