From bada6b888654337c2a8c0df8970a21d055670965 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Fri, 28 Mar 2025 23:06:23 +0200 Subject: [PATCH] Fix AssetEditorWindows not getting restored after script recompilation --- Source/Editor/Modules/WindowsModule.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Editor/Modules/WindowsModule.cs b/Source/Editor/Modules/WindowsModule.cs index 6c4af3b2f..7944db398 100644 --- a/Source/Editor/Modules/WindowsModule.cs +++ b/Source/Editor/Modules/WindowsModule.cs @@ -821,17 +821,18 @@ namespace FlaxEditor.Modules } internal void AddToRestore(CustomEditorWindow win) - { - AddToRestore(win.Window, win.GetType(), new WindowRestoreData()); - } - - private void AddToRestore(EditorWindow win, Type type, WindowRestoreData winData) { // Validate if can restore type + var type = win.GetType(); var constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); if (constructor == null || type.IsGenericType) return; + AddToRestore(win.Window, type, new WindowRestoreData()); + } + + private void AddToRestore(EditorWindow win, Type type, WindowRestoreData winData) + { var panel = win.ParentDockPanel; // Ensure that this window is only selected following recompilation