Singularity/Library/PackageCache/com.unity.2d.psdimporter@6.0.7/Editor/PSDImportPostProcessor.cs
2024-05-06 11:45:45 -07:00

32 lines
1.0 KiB
C#

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;
}
}
}
}
}
}