mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-17 18:40:33 +00:00
fix(NetworkManager): offlineSceneLoadDelaySeconds -> offlineSceneLoadDelay and Range 0-60
This commit is contained in:
parent
bc9329a825
commit
bb552f8a54
@ -76,8 +76,8 @@ public class NetworkManager : MonoBehaviour
|
||||
[Tooltip("Scene that Mirror will switch to when the server is started. Clients will recieve a Scene Message to load the server's current scene when they connect.")]
|
||||
public string onlineScene = "";
|
||||
|
||||
[Tooltip("Optional delay that can be used after disconnecting to show a 'Connection lost...' message or similar before loading the offline scene, which may take a long time in big projects.")]
|
||||
public float offlineSceneLoadDelaySeconds = 0;
|
||||
[Range(0, 60), Tooltip("Optional delay that can be used after disconnecting to show a 'Connection lost...' message or similar before loading the offline scene, which may take a long time in big projects.")]
|
||||
public float offlineSceneLoadDelay = 0;
|
||||
|
||||
// transport layer
|
||||
[Header("Network Info")]
|
||||
@ -1335,9 +1335,7 @@ void OnClientDisconnectInternal()
|
||||
// Check loadingSceneAsync to ensure we don't double-invoke the scene change.
|
||||
// Check if NetworkServer.active because we can get here via Disconnect before server has started to change scenes.
|
||||
if (!string.IsNullOrWhiteSpace(offlineScene) && !Utils.IsSceneActive(offlineScene) && loadingSceneAsync == null && !NetworkServer.active)
|
||||
{
|
||||
Invoke(nameof(ClientChangeOfflineScene), offlineSceneLoadDelaySeconds);
|
||||
}
|
||||
Invoke(nameof(ClientChangeOfflineScene), offlineSceneLoadDelay);
|
||||
|
||||
networkSceneName = "";
|
||||
}
|
||||
@ -1361,9 +1359,7 @@ void OnClientSceneInternal(SceneMessage msg)
|
||||
|
||||
// This needs to run for host client too. NetworkServer.active is checked there
|
||||
if (NetworkClient.isConnected)
|
||||
{
|
||||
ClientChangeScene(msg.sceneName, msg.sceneOperation, msg.customHandling);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Called on the server when a new client connects.</summary>
|
||||
|
Loading…
Reference in New Issue
Block a user