Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 6dbc951

Browse files
committed
Check for missing PostProcessStrippingConfig.asset *after* assets are imported
1 parent 3fd55f5 commit 6dbc951

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

PostProcessing/Editor/PostProcessResourceStripper.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ public void OnPreprocessBuild(BuildTarget target, string path)
204204
}
205205
#endif
206206

207-
208-
[InitializeOnLoad]
209-
public class SetupStrippingConfig
207+
public class SetupStrippingConfig : AssetPostprocessor
210208
{
211-
static SetupStrippingConfig()
209+
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
212210
{
213-
PostProcessResourceStripper.EnsurePostProcessStrippingConfigAssetExists();
211+
// check if the config asset is missing, but only after other .asset files have been imported
212+
if (Array.FindIndex(importedAssets, asset => asset != null && asset.Contains("PostProcessResources.asset")) > -1)
213+
PostProcessResourceStripper.EnsurePostProcessStrippingConfigAssetExists();
214214
}
215215
}
216216
}

0 commit comments

Comments
 (0)