wuxianshengcong/Library/PackageCache/com.unity.2d.psdimporter@8.0.5/Editor/PSDImporterAssetPostProcessor.cs
2025-01-02 14:50:41 +08:00

30 lines
949 B
C#

using System.Collections.Generic;
namespace UnityEditor.U2D.PSD
{
class PSDImporterAssetPostProcessor : AssetPostprocessor
{
static List<PSDImporter> s_AssetImporter;
public override int GetPostprocessOrder() => int.MinValue;
void OnPreprocessAsset()
{
if (assetImporter is PSDImporter)
{
if(s_AssetImporter == null)
s_AssetImporter = new List<PSDImporter>();
s_AssetImporter.Add((PSDImporter)assetImporter);
}
}
internal static bool ContainsImporter(PSDImporter importer)
{
return s_AssetImporter == null ? false : s_AssetImporter.Contains(importer);
}
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
s_AssetImporter = null;
}
}
}