From 2cb9278db03fcd601b46285df89bf103e4ef69d3 Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 19 Jul 2022 19:20:51 +0800 Subject: [PATCH] Update AssetBundleCollector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 资源收集增加无效文件的过滤。 --- .../AssetBundleCollector/AssetBundleCollector.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index 2bd27d3..cd0d742 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -190,14 +190,22 @@ namespace YooAsset.Editor return false; } + // 忽略文件夹 if (AssetDatabase.IsValidFolder(assetPath)) return false; - // 注意:忽略编辑器下的类型资源 + // 忽略编辑器下的类型资源 Type type = AssetDatabase.GetMainAssetTypeAtPath(assetPath); if (type == typeof(LightingDataAsset)) return false; + // 忽略Unity无法识别的无效文件 + if (type == typeof(UnityEditor.DefaultAsset)) + { + UnityEngine.Debug.LogWarning($"Cannot pack default asset : {assetPath}"); + return false; + } + string ext = System.IO.Path.GetExtension(assetPath); if (ext == "" || ext == ".dll" || ext == ".cs" || ext == ".js" || ext == ".boo" || ext == ".meta" || ext == ".cginc") return false;