changing variables of all instanced Gameobject

hey everyone, im currently creating a tower defence, the snag im into is that i want after each wave, the enemies level to increase along with all its stats, the thing is, how do i access all the instanced enemies scripts so i can call my function that increases their stats(in a script directly attached to the instanced enemy. if i edit the prefab, that works, but the problem is that it doesnt go back to the default values after the game is done. any clues?

For something like this I would use a spawn controller that instantiates the enemies and saves them in an array or a list. Then when you want to change the level you can just loop throught the array of enemies and change any value you want. like:

//enemyArray would be your list of enemies

for (var enemy:Transform in enemyArray){

    enemy.GetComponent(yourEnemyScript).level += 1;
}

But this way of changing the level would only be usefull if you want some waves to have enemies of different level. A good idea would be to have a ‘global’ variable level and the enemies could reference this variable so you wouldn’t need to change them all just change the global variabl and all of the enemies would update acording.