Update DefaultFilterRule.cs

修复了精灵过滤器无效的问题。
pull/17/head
hevinci 2022-06-23 13:46:31 +08:00
parent 3cbf891674
commit 8f02bfa3a6
1 changed files with 11 additions and 2 deletions

View File

@ -44,10 +44,19 @@ namespace YooAsset.Editor
{
public bool IsCollectAsset(FilterRuleData data)
{
if (AssetDatabase.GetMainAssetTypeAtPath(data.AssetPath) == typeof(Sprite))
return true;
var mainAssetType = AssetDatabase.GetMainAssetTypeAtPath(data.AssetPath);
if(mainAssetType == typeof(Texture2D))
{
var texImporter = TextureImporter.GetAtPath(data.AssetPath) as TextureImporter;
if (texImporter != null && texImporter.textureType == TextureImporterType.Sprite)
return true;
else
return false;
}
else
{
return false;
}
}
}
}