mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: StopHost with offline scene calls scene change twice (#1409)
* Separate StopHostClient * Added comments * move comment * add comment * Changed to loadingSceneAsync check * Update Assets/Mirror/Runtime/NetworkManager.cs Co-authored-by: vis2k <info@noobtuts.com>
This commit is contained in:
parent
29c96b6bc0
commit
a0c96f8518
@ -613,7 +613,9 @@ public void StopClient()
|
||||
// doesn't think we need initialize anything.
|
||||
mode = NetworkManagerMode.Offline;
|
||||
|
||||
if (!string.IsNullOrEmpty(offlineScene) && SceneManager.GetActiveScene().name != offlineScene)
|
||||
// If this is the host player, StopServer will already be changing scenes.
|
||||
// Check loadingSceneAsync to ensure we don't double-invoke the scene change.
|
||||
if (!string.IsNullOrEmpty(offlineScene) && SceneManager.GetActiveScene().name != offlineScene && loadingSceneAsync == null)
|
||||
{
|
||||
ClientChangeScene(offlineScene, SceneOperation.Normal);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user