internal static void DomainUnloadOrPlayModeChangeShutdown() { #if !UNITY_DOTSRUNTIME if (!s_UnloadOrPlayModeChangeShutdownRegistered) { return; } var playerLoop = PlayerLoop.GetCurrentPlayerLoop(); foreach (var w in World.s_AllWorlds) { ScriptBehaviourUpdateOrder.RemoveWorldFromPlayerLoop(w, ref playerLoop); } PlayerLoop.SetPlayerLoop(playerLoop); World.DisposeAllWorlds(); WordStorage.Instance.Dispose(); WordStorage.Instance = null; s_UnloadOrPlayModeChangeShutdownRegistered = false; DefaultWorldDestroyed?.Invoke(); #endif }
internal static void DomainUnloadOrPlayModeChangeShutdown() { if (!s_UnloadOrPlayModeChangeShutdownRegistered) { return; } World.DisposeAllWorlds(); WordStorage.Instance.Dispose(); WordStorage.Instance = null; ScriptBehaviourUpdateOrder.UpdatePlayerLoop(null); s_UnloadOrPlayModeChangeShutdownRegistered = false; DefaultWorldDestroyed?.Invoke(); }