Skip to content

Commit 5d6114a

Browse files
committed
Added error message to scene manager
1 parent 4f5ce9e commit 5d6114a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

MLAPI/Data/NetworkingConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class NetworkingConfiguration
3131
//TODO
3232
public bool EncryptMessages = false;
3333
public bool AllowPassthroughMessages = true;
34-
public bool EnableSceneSwitching = true;
34+
public bool EnableSceneSwitching = false;
3535

3636
//Cached config hash
3737
private byte[] ConfigHash = null;

MLAPI/NetworkingManagerComponents/NetworkSceneManager.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ public static class NetworkSceneManager
1818

1919
internal static void SetCurrentSceneIndex ()
2020
{
21+
if(!sceneNameToIndex.ContainsKey(SceneManager.GetActiveScene().name))
22+
{
23+
Debug.LogWarning("MLAPI: Scene switching is enabled but the current scene (" + SceneManager.GetActiveScene().name + ") is not regisered as a network scene.");
24+
return;
25+
}
2126
CurrentSceneIndex = sceneNameToIndex[SceneManager.GetActiveScene().name];
2227
}
2328

0 commit comments

Comments
 (0)