Fix preserving Editor undo actions during play mode
This commit is contained in:
@@ -359,9 +359,7 @@ namespace FlaxEditor.Modules
|
|||||||
{
|
{
|
||||||
Editor.SceneEditing.Deselect();
|
Editor.SceneEditing.Deselect();
|
||||||
|
|
||||||
// TODO: this works in most cases fine but we still need to handle the case when assembly gets reloaded and type references are invalid
|
if (fullCleanup)
|
||||||
// TODO: To solve this: serialize type reference as 'namespace.name' in undo data storage
|
|
||||||
//if (fullCleanup)
|
|
||||||
{
|
{
|
||||||
Undo.Clear();
|
Undo.Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace FlaxEditor.Progress.Handlers
|
|||||||
_selectionCache.Cache();
|
_selectionCache.Cache();
|
||||||
|
|
||||||
// Clear references to the user scripts (we gonna reload an assembly)
|
// Clear references to the user scripts (we gonna reload an assembly)
|
||||||
Editor.Instance.Scene.ClearRefsToSceneObjects();
|
Editor.Instance.Scene.ClearRefsToSceneObjects(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnScriptsReload()
|
private void OnScriptsReload()
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ namespace FlaxEditor.States
|
|||||||
CacheSelection();
|
CacheSelection();
|
||||||
|
|
||||||
// Remove references to the scene objects
|
// Remove references to the scene objects
|
||||||
Editor.Scene.ClearRefsToSceneObjects(true);
|
Editor.Scene.ClearRefsToSceneObjects();
|
||||||
|
|
||||||
// Apply game settings (user may modify them before the gameplay)
|
// Apply game settings (user may modify them before the gameplay)
|
||||||
GameSettingsApplying?.Invoke();
|
GameSettingsApplying?.Invoke();
|
||||||
@@ -158,7 +158,7 @@ namespace FlaxEditor.States
|
|||||||
IsPaused = true;
|
IsPaused = true;
|
||||||
|
|
||||||
// Remove references to the scene objects
|
// Remove references to the scene objects
|
||||||
Editor.Scene.ClearRefsToSceneObjects(true);
|
Editor.Scene.ClearRefsToSceneObjects();
|
||||||
|
|
||||||
// Restore editor scene
|
// Restore editor scene
|
||||||
SceneRestoring?.Invoke();
|
SceneRestoring?.Invoke();
|
||||||
|
|||||||
Reference in New Issue
Block a user