diff --git a/Editor/LLMBuildProcessor.cs b/Editor/LLMBuildProcessor.cs index e5e61b0f..f0638a88 100644 --- a/Editor/LLMBuildProcessor.cs +++ b/Editor/LLMBuildProcessor.cs @@ -51,8 +51,12 @@ public void OnPostprocessBuild(BuildReport report) public void BuildCompleted() { - Application.logMessageReceived -= OnBuildError; - LLMBuilder.Reset(); + // Delay the reset operation to ensure Unity is no longer in the build process + EditorApplication.delayCall += () => + { + Application.logMessageReceived -= OnBuildError; + LLMBuilder.Reset(); + }; } } }