mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
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:
parent
95705a1545
commit
bc37497ac9
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user