From 8f02bfa3a65d80c703573d5bde676551d89474ee Mon Sep 17 00:00:00 2001 From: hevinci Date: Thu, 23 Jun 2022 13:46:31 +0800 Subject: [PATCH] Update DefaultFilterRule.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了精灵过滤器无效的问题。 --- .../AssetBundleCollector/DefaultFilterRule.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultFilterRule.cs b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultFilterRule.cs index 2141774..0549dcc 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultFilterRule.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultFilterRule.cs @@ -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; + } } } } \ No newline at end of file