Fix AssetEditorWindows not getting restored after script recompilation

This commit is contained in:
2025-03-28 23:06:23 +02:00
parent faa3f62813
commit bada6b8886

View File

@@ -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