Postprocess.cs 733 B

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