From bc37497ac963bb0f2820b103591afd05177d078d Mon Sep 17 00:00:00 2001 From: MrGadget Date: Fri, 10 Apr 2020 11:42:38 -0400 Subject: [PATCH] fix: Re-enable transport if aborting additive load/unload (#1683) * fix: Re-enable transports if aborting additive load/unload * Restore debug if's --- Assets/Mirror/Runtime/NetworkManager.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/Mirror/Runtime/NetworkManager.cs b/Assets/Mirror/Runtime/NetworkManager.cs index e0badaeff..dced7966b 100644 --- a/Assets/Mirror/Runtime/NetworkManager.cs +++ b/Assets/Mirror/Runtime/NetworkManager.cs @@ -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; }