Postprocess.cs 762 B

123456789101112131415161718192021222324252627
  1. namespace AtlasUtility
  2. {
  3. using UnityEditor;
  4. using UnityEngine;
  5. using System.IO;
  6. using System.Reflection;
  7. using System.Collections.Generic;
  8. public class Postprocess : AssetPostprocessor
  9. {
  10. public static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
  11. {
  12. List<string> pngPathList = new List<string>();
  13. for (int i = 0; i < deletedAssets.Length; i++)
  14. {
  15. if (Path.GetExtension(deletedAssets[i]) == ".png")
  16. {
  17. pngPathList.Add(deletedAssets[i]);
  18. }
  19. }
  20. ReferenceManager.ResetReference(pngPathList);
  21. }
  22. }
  23. }