fix: Re-enable transport if aborting additive load/unload (#1683)

* fix: Re-enable transports if aborting additive load/unload

* Restore debug if's
This commit is contained in:
MrGadget 2020-04-10 11:42:38 -04:00 committed by GitHub
parent 95705a1545
commit bc37497ac9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -853,16 +853,24 @@ internal void ClientChangeScene(string newSceneName, SceneOperation sceneOperati
if (!SceneManager.GetSceneByName(newSceneName).IsValid())
loadingSceneAsync = SceneManager.LoadSceneAsync(newSceneName, LoadSceneMode.Additive);
else
{
Debug.LogWarningFormat("Scene {0} is already loaded", newSceneName);
Transport.activeTransport.enabled = true;
}
break;
case SceneOperation.UnloadAdditive:
if (SceneManager.GetSceneByName(newSceneName).IsValid())
{
if (SceneManager.GetSceneByName(newSceneName) != null)
loadingSceneAsync = SceneManager.UnloadSceneAsync(newSceneName, UnloadSceneOptions.UnloadAllEmbeddedSceneObjects);
else
Transport.activeTransport.enabled = true;
}
else
{
Debug.LogWarning("Cannot unload the active scene with UnloadAdditive operation");
Transport.activeTransport.enabled = true;
}
break;
}