I've written a AssetPostProcessor script that make some changes to prefabs and materials on import in some specific folders. I'm using this method to do that:
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath)
{
// if the importedAsset is a prefab
GameObject obj = (GameObject)AssetDatabase.LoadAssetAtPath(objName, typeof(GameObject));
if (obj) {
if (AssetDatabase.GetAssetPath(obj).Contains("Assets/Tiled2Unity/Prefabs")) {
// Here's some code that changes the asset
}
}
}
For some reason, every time I save this AssetPostProcessor is run which is something I don't want because this is lost time for something that isn't needed. What can I do to stop this?