Simple spawn balancing
Let’s go over a simple implementation of how to balance the spawning in the game.
The SpawnManager was adjusted to handle waves than one enemy in this article.
This is a bit down to preferences, however, I prefer handling the chance of random events based on percentage. Open the SpawnManager script and in the SpawmEnemyRoutine add an int to take a random value from 1–100 (remember the upper value in Random.Range is exclusive for ints, so if set to 101 it means it goes up to 100). Also add a local int that later on will take the value of which enemy to spawn:
Add the same amount of if statements as there are enemy objects in the array. Set the chances based on how difficult an enemy is, i.e higher chance for a simple enemy to spawn:
Lastly, spawn the enemy:
You can use the same balancing logic for the power-ups as well: