From 0b007ef5c9373da13449308970daee419022b4e1 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Fri, 2 May 2025 14:03:14 +0300 Subject: [PATCH] Defer loading XML documentation during while loading the editor --- Source/Editor/CustomEditors/CustomEditorPresenter.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Editor/CustomEditors/CustomEditorPresenter.cs b/Source/Editor/CustomEditors/CustomEditorPresenter.cs index 62db53cab..058e712d0 100644 --- a/Source/Editor/CustomEditors/CustomEditorPresenter.cs +++ b/Source/Editor/CustomEditors/CustomEditorPresenter.cs @@ -325,6 +325,7 @@ namespace FlaxEditor.CustomEditors } private bool _buildOnUpdate; + private bool _initialized; private bool _readOnly; /// @@ -412,6 +413,7 @@ namespace FlaxEditor.CustomEditors ClearLayout(); _buildOnUpdate = false; + _initialized = true; Editor.Setup(this); Panel.IsLayoutLocked = false; @@ -488,7 +490,11 @@ namespace FlaxEditor.CustomEditors /// protected virtual void OnSelectionChanged() { - BuildLayout(); + // Defer building the layout after we have initialized to improve initial loading times + if (!_initialized) + _buildOnUpdate = true; + else + BuildLayout(); SelectionChanged?.Invoke(); }