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
19
19
20
20
public static void SwitchScene ( string sceneName )
21
21
{
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 )
23
28
{
24
29
Debug . LogWarning ( "MLAPI: Scene switch already in progress" ) ;
25
30
return ;
@@ -45,7 +50,12 @@ public static void SwitchScene(string sceneName)
45
50
46
51
internal static void OnSceneSwitch ( uint sceneIndex )
47
52
{
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 ] ) )
49
59
{
50
60
Debug . LogWarning ( "MLAPI: Server requested a scene switch to a non registered scene" ) ;
51
61
return ;
You can’t perform that action at this time.
0 commit comments