fix: Don't call FinishLoadScene when customHandling (#2794)

* fix: Don't call FinishLoadScene when customHandling
FinishLoadScene will be called from `UpdateScene`  if `loadingSceneAsync != null && loadingSceneAsync.isDone` and it's the responsibility of the user in their custom handler to assign `loadingSceneAsync` to something to block FinishLoadScene until that completes.

* Update Assets/Mirror/Runtime/NetworkManager.cs

Co-authored-by: vis2k <info@noobtuts.com>
This commit is contained in:
MrGadget 2021-06-22 01:29:49 -04:00 committed by GitHub
parent ae05d10903
commit 92334ba2aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -800,11 +800,11 @@ internal void ClientChangeScene(string newSceneName, SceneOperation sceneOperati
OnClientChangeScene(newSceneName, sceneOperation, customHandling);
// scene handling will happen in overrides of OnClientChangeScene and/or OnClientSceneChanged
// Do not call FinishLoadScene here. Custom handler will assign loadingSceneAsync and we need
// to wait for that to finish. UpdateScene already checks for that to be not null and isDone.
// (in other words, custom loading needs to call FinishLoadScene when they are done)
if (customHandling)
{
FinishLoadScene();
return;
}
switch (sceneOperation)
{