|
Post by sampenguin on Jun 18, 2019 15:50:16 GMT
I just setup a pretty straightforward global wave setup. 1 level, 1 wave, default settings (so 5 second duration), SyncroSpawner set up to use a prefab (which is also configured in the PoolBoss), tweaks to position settings. When I visualize spawner results in edit mode, it looks like what I expect. However, when I hit play in editor, and look at LevelSettings, it's somehow not setting the remaining time for that wave... it's displaying as 0 time remaining, but it's also not ending... and nothing spawns. Any ideas? I set a breakpoint in LevelSettings.TimeRemainingInCurrentWave (set) and it's never getting hit. 
|
|
|
Post by sampenguin on Jun 18, 2019 16:13:21 GMT
Setting some more breakpoints, and it looks like LevelSettings.CoUpdate is not executing properly. yield return _loopDelay stops on a breakpoint exactly one time and never again; no subsequent code is ever reached (which is basically everything that LevelSettings does). Totally lost for ideas here.
private IEnumerator CoUpdate() { while (true) { yield return _loopDelay;
|
|
|
Post by sampenguin on Jun 18, 2019 17:00:24 GMT
So after just trying random stuff, I discovered if I moved the LevelSettings object (and all its children) out of the object it was a child of, it worked. The previous parent was getting disabled as part of gameplay until it was time to enable it, so the LevelSettings object was not active in hierarchy until that point.
This leads me to believe that if LevelSettings gameObject becomes disabled (as a result of nesting, it was still set active itself) during scene startup, some logic path in Awake or Start gets broken, or some kind of message is missed that it needs to handle.
This isn't ideal for managing my scene hierarchy in a clean fashion, but I will work around it as a limitation of LevelSettings, unless there is some magic method to call after re-enabling the LevelSettings go that I'm missing that will make sure it's been initialized correctly.
Hopefully this thread helps anyone else who comes across the same problem.
|
|
|
Post by DarkTonic Dev on Jun 18, 2019 18:50:12 GMT
Well it's not a supported Scenario to parent LevelSettings under anything. Glad you figured it out.
|
|