File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
MLAPI/NetworkingManagerComponents Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,12 @@ internal static class NetworkSceneManager
1919
2020 public static void SwitchScene ( string sceneName )
2121 {
22- if ( isSwitching )
22+ if ( ! NetworkingManager . singleton . NetworkConfig . EnableSceneSwitching )
23+ {
24+ Debug . LogWarning ( "MLAPI: Scene switching is not enabled" ) ;
25+ return ;
26+ }
27+ else if ( isSwitching )
2328 {
2429 Debug . LogWarning ( "MLAPI: Scene switch already in progress" ) ;
2530 return ;
@@ -45,7 +50,12 @@ public static void SwitchScene(string sceneName)
4550
4651 internal static void OnSceneSwitch ( uint sceneIndex )
4752 {
48- if ( ! sceneIndexToString . ContainsKey ( sceneIndex ) || registeredSceneNames . Contains ( sceneIndexToString [ sceneIndex ] ) )
53+ if ( ! NetworkingManager . singleton . NetworkConfig . EnableSceneSwitching )
54+ {
55+ Debug . LogWarning ( "MLAPI: Scene switching is not enabled but was requested by the server" ) ;
56+ return ;
57+ }
58+ else if ( ! sceneIndexToString . ContainsKey ( sceneIndex ) || registeredSceneNames . Contains ( sceneIndexToString [ sceneIndex ] ) )
4959 {
5060 Debug . LogWarning ( "MLAPI: Server requested a scene switch to a non registered scene" ) ;
5161 return ;
You can’t perform that action at this time.
0 commit comments