private void OnStopGame(object argument) { IsInPlayMode = false; CEngine.Instance.Dispatch(EEngineUpdatePriority.BeginFrame, () => { CWorld world = CEngine.Instance.CurrentWorld; world.StopPlayMode(); world.ChangeLevel(null, m_prePlayModeLevel.GetLevel()); Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() => { OpenedLevelAsset = m_prePlayModeLevelReference; m_prePlayModeLevel = null; m_prePlayModeLevelReference = null; UndoRedoUtility.Purge(null); UndoRedoModel.IsRecording = true; GetTool <CViewportViewModel>().FreeMouseCursor(); })); }); }