From 800b163de9e32c996db892f92db1f6abd5ee3c52 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 30 Jul 2024 17:17:27 +0300 Subject: [PATCH] Fix ContentDatabase not being loaded at the end of editor initialization --- Source/Editor/Modules/ContentDatabaseModule.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Modules/ContentDatabaseModule.cs b/Source/Editor/Modules/ContentDatabaseModule.cs index 3fdac16e5..f5d7dfe61 100644 --- a/Source/Editor/Modules/ContentDatabaseModule.cs +++ b/Source/Editor/Modules/ContentDatabaseModule.cs @@ -90,6 +90,7 @@ namespace FlaxEditor.Modules FlaxEngine.Json.JsonSerializer.Settings.Converters.Add(new AssetItemConverter()); ScriptsBuilder.ScriptsReloadBegin += OnScriptsReloadBegin; + ScriptsBuilder.ScriptsReloadEnd += OnScriptsReloadEnd; } private void OnContentAssetDisposing(Asset asset) @@ -1232,8 +1233,6 @@ namespace FlaxEditor.Modules LoadProjects(Game.Project); } - RebuildInternal(); - Editor.ContentImporting.ImportFileEnd += (obj, failed) => { var path = obj.ResultUrl; @@ -1356,6 +1355,11 @@ namespace FlaxEditor.Modules _enableEvents = enabledEvents; } + private void OnScriptsReloadEnd() + { + RebuildInternal(); + } + /// public override void OnUpdate() {