internal static void UpdateScene()
{
#if UNITY_EDITOR
// In the editor, reloading scripts in play mode causes a Mono Domain Reload.
// This gets the transport layer (C++) and HLAPI (C#) out of sync.
// This check below detects that problem and shuts down the transport layer to bring both systems back in sync.
if (singleton == null && s_PendingSingleton != null && s_DomainReload)
{
if (LogFilter.logWarn)
{
Debug.LogWarning("NetworkManager detected a script reload in the editor. This has caused the network to be shut down.");
}
s_DomainReload = false;
s_PendingSingleton.InitializeSingleton();
// destroy network objects
var uvs = FindObjectsOfType <NetworkIdentity>();
foreach (var uv in uvs)
{
GameObject.Destroy(uv.gameObject);
}
singleton.StopHost();
NetworkTransport.Shutdown();
}
#endif
if (singleton == null)
{
return;
}
if (s_LoadingSceneAsync == null)
{
return;
}
if (!s_LoadingSceneAsync.isDone)
{
return;
}
if (LogFilter.logDebug)
{
Debug.Log("ClientChangeScene done readyCon:" + s_ClientReadyConnection);
}
singleton.FinishLoadScene();
s_LoadingSceneAsync.allowSceneActivation = true;
s_LoadingSceneAsync = null;
}