I have a single level setup with one wave and one spawner. They are configured as elimination and to repeat endless. I have a use case where a spawned item is not destroyed but I need to move onto the next repeated wave, and I need to trigger this via code. How should I go about this?
Post by DarkTonic Dev on Sept 20, 2018 19:23:10 GMT
Not exactly. You can use LevelSettings.RestartCurrentWave().
It will unfortunately probably reset back to zero any changes to wave size and duration from Spawn Increase and Time Increase settings, if you're using them. Those fields appear in the Repeat Wave section on the Spawner.
Post by DarkTonic Dev on Sept 20, 2018 19:25:53 GMT
You also could just destroy any leftover undestroyed spawns and it will trigger the next wave automatically.
If you're spawning a single prefab type, use Pool Boss API. If it's many (Prefab Pool), you can get all the remaining spawns from the Spawner itself with .SpawnedWaveMembers property and despawn all of them.
Ok thanks. The issue is that the game has a couple of states for triggering the repeat of a wave. The first being all spawned items are destroyed, the second is if another action occurs then it needs to trigger the next repeat.