- Home /
Wave manager that enables multiple gameobjects after X seconds?
Hey there everyone, I could use some help.
I want to have a WaveManager that would enable new gameobjects (wavecontrollers that would spawn in the in the enemies). So basically, having a WaveManager that enables multiple objects at different times. It should be able to enable multiple gameobjects after X seconds in one Wave. The problem is that I'm not able to access the waveControllers gameobjects nor the timer int.
For example
The Wave 1 class in the Inspector would Enable the Wave1 gameobjects after X seconds.
The Wave 2 class in the Inspector would Enable the Wave2 gameobjects after X seconds.
The script would just keep on enabling the different wave game objects after X seconds. I started something that I think should work, but I'm not too sure on how to do it.
//This allows for multiple waves each with their own
//unique timer and game object waveControllers
[System.Serializable]
public class Wave
{
public int timer;
public GameObject[] waveControllers;
}
IEnumerator WaveTimer(Wave _wave)
{
yield return new WaitForSeconds(timer);
//Enables the new waveController that is after the
//one before it
}
If you need more information or anything like that, please let me know. I could really use some help with this.