Not A Bug OnSceneLoaded event not being called

mrmr32

Well-known member
Messages
123
Reactions
317
Points
63
Website
github.com
Patreon
mrmr32
Inside SuperController there's a variable (onSceneLoadedHandlers) that should call all the listeners when _isLoading becomes true, but that's not the case.
If you see the usages of that variable, at least in that class is completely unused. As an example, onSceneSavedHandlers is virtually the same and it is called inside SaveInternalFinish():
C#:
if (this.onSceneSavedHandlers != null)
    this.onSceneSavedHandlers();

I'm using VAM version 1.20.77.9.
 
While there's alternatives to solve this bug (I'll attach my own below), some developers may be confused trying to use that variable and that doesn't work. Emphasize that using that variable (once it work) would be more efficient than all the plugins using my solution.

C#:
private IEnumerator DoActionAfterSceneCompleted() {
    while (SuperController.singleton.isLoading) yield return new WaitForSeconds(0.5f);

    // the scene is loaded
    // ...
}

Then, add this call in the Start(): StartCoroutine(DoActionAfterSceneCompleted());
 
Going back through old reports and it is being called properly at the end of LoadCo method after scene is fully loaded as it should be. isLoading signifies that it is actively loading.
 
Back
Top Bottom