Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PSDImportPostProcessor.cs 1.0KB

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. namespace UnityEditor.U2D.PSD
  3. {
  4. internal class PSDImportPostProcessor : AssetPostprocessor
  5. {
  6. private static string s_CurrentApplyAssetPath = null;
  7. public static string currentApplyAssetPath
  8. {
  9. set { s_CurrentApplyAssetPath = value; }
  10. }
  11. static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath)
  12. {
  13. if (!string.IsNullOrEmpty(s_CurrentApplyAssetPath))
  14. {
  15. foreach (var asset in importedAssets)
  16. {
  17. if (asset == s_CurrentApplyAssetPath)
  18. {
  19. var obj = AssetDatabase.LoadMainAssetAtPath(asset);
  20. Selection.activeObject = obj;
  21. Unsupported.SceneTrackerFlushDirty();
  22. s_CurrentApplyAssetPath = null;
  23. break;
  24. }
  25. }
  26. }
  27. }
  28. }
  29. }