12345678910111213141516171819202122232425262728293031 |
- using UnityEngine;
-
- namespace UnityEditor.U2D.PSD
- {
- internal class PSDImportPostProcessor : AssetPostprocessor
- {
- private static string s_CurrentApplyAssetPath = null;
-
- public static string currentApplyAssetPath
- {
- set { s_CurrentApplyAssetPath = value; }
- }
- static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath)
- {
- if (!string.IsNullOrEmpty(s_CurrentApplyAssetPath))
- {
- foreach (var asset in importedAssets)
- {
- if (asset == s_CurrentApplyAssetPath)
- {
- var obj = AssetDatabase.LoadMainAssetAtPath(asset);
- Selection.activeObject = obj;
- Unsupported.SceneTrackerFlushDirty();
- s_CurrentApplyAssetPath = null;
- break;
- }
- }
- }
- }
- }
- }
|