Skip to content

Commit

Permalink
fix: managing flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sator-imaging committed Mar 20, 2023
1 parent d5a621d commit 75c65f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Editor/USGUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ public static void ForceGenerateByName(string clsName, bool showInProjectPanel =
if (path == null) return;


var restoreOverwriteSetting = USGEngine.IgnoreOverwriteSettingByAttribute;
USGEngine.IgnoreOverwriteSettingByAttribute = true; // always disabled after import event.

// NOTE: Invoking unity editor event while building app causes fatal error.
// just generate code and not need to import it.
if (BuildPipeline.isBuildingPlayer)
{
USGEngine.ProcessFile(path);
// because of Editor event doesn't happens.
USGEngine.IgnoreOverwriteSettingByAttribute = restoreOverwriteSetting;
return;
}

Expand Down

0 comments on commit 75c65f9

Please sign in to comment.