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(); }