Skip to content

Commit 4a35072

Browse files
committed
chore: move asset creation to delaycall
1 parent b30a262 commit 4a35072

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

Editor/EditorAssetGenerator.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ public class EditorAssetGenerator
1111

1212
static EditorAssetGenerator()
1313
{
14-
if (!Resources.Load<AvatarLoaderSettings>(AvatarLoaderSettings.SETTINGS_PATH))
15-
{
16-
CreateSettingsAssets();
17-
}
14+
EditorApplication.delayCall += CreateSettingsAssets;
15+
}
16+
17+
~EditorAssetGenerator()
18+
{
19+
EditorApplication.delayCall -= CreateSettingsAssets;
1820
}
1921

2022
private static void CreateSettingsAssets()

Editor/Module Management/ModuleInstaller.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static ModuleInstaller()
4646
if (!modulesInstalled)
4747
{
4848
InstallModules();
49-
CoreSettingsHandler.CreateCoreSettings();
49+
EditorApplication.delayCall += DelayCreateCoreSettings;
5050
}
5151

5252
#if !GLTFAST
@@ -56,7 +56,13 @@ static ModuleInstaller()
5656
AddScriptingDefineSymbolToAllBuildTargetGroups(READY_PLAYER_ME_SYMBOL);
5757
}
5858
#endif
59-
59+
60+
}
61+
62+
private static void DelayCreateCoreSettings()
63+
{
64+
CoreSettingsHandler.CreateCoreSettings();
65+
EditorApplication.delayCall -= DelayCreateCoreSettings;
6066
}
6167

6268
/// <summary>

0 commit comments

Comments
 (0)