I've seen this issue for a while, but just never got around to reporting it. I might be doing something wrong, but I just can't see what it is. In some cases when I set a Custom Start Wave, it complains with the following error when I run the game:
Illegal Start Wave# specified in Level Settings. Level 3 only has 0 wave(s). Aborting. UnityEngine.Debug:LogError(Object) DarkTonic.CoreGameKit.LevelSettings:LogIfNew(String, Boolean) (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/Level/LevelSettings.cs:1229) DarkTonic.CoreGameKit.LevelSettings:CheckForValidVariables() (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/Level/LevelSettings.cs:481) DarkTonic.CoreGameKit.LevelSettings:Start() (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/Level/LevelSettings.cs:444)
In this case, I've set custom start wave to Level 3 Wave 1. If I look at LevelSettings for Level 3 Wave 1 in the editor it shows that there is 1 wave and 2 spawners set up. See image below:
I could only get that to happen if you have Custom Start Wave to set something that doesn't exist, i.e. Level 3, Wave 2 when you only have 1 wave. Take a look at your Custom Start Wave settings. If it's not illegal then let me know how to reproduce, because I couldn't.
I have it set to the correct setting of Level 3 Wave 1 and it definitely existed. I've gotten around it by just adding another wave so I'm OK for now. But it definitely happens for no apparent reason. If I have time to debug it in the code then I'll let you know what I find.
Next time you see it happen go to debug mode in the Inspector and see if the variable "startWaveNumber" is set to something different that what's being displayed. I can only imagine that I have code that sets it to the max wave but maybe doesn't save it in some cases?
It's line 479 and I definitely have a Level 4 with one wave in it. So, since the fake wave is only created on the last level then this makes sense. Level 3 has a single wave and your calculation subtracts 1 so it thinks it has 0 waves.