From cd6268631668255658b93b34e63d0ce1b427301f Mon Sep 17 00:00:00 2001 From: hevinci Date: Sat, 26 Nov 2022 17:54:42 +0800 Subject: [PATCH] update editor code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 非原生文件收集器自动移除Unity无法识别的文件。 --- .../AssetBundleBuilder/AssetBundleSimulateBuilder.cs | 2 ++ .../AssetBundleCollector/AssetBundleCollector.cs | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs index 11ebe67..ce1b65a 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs @@ -1,4 +1,5 @@ using UnityEditor; +using UnityEngine; namespace YooAsset.Editor { @@ -9,6 +10,7 @@ namespace YooAsset.Editor /// public static string SimulateBuild(string packageName) { + Debug.Log($"Begin to create simulate package : {packageName}"); string defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultOutputRoot(); BuildParameters buildParameters = new BuildParameters(); buildParameters.OutputRoot = defaultOutputRoot; diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index 4e7d568..292ed67 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -240,13 +240,15 @@ namespace YooAsset.Editor return false; // 忽略Unity无法识别的无效文件 - /* - if (type == typeof(UnityEditor.DefaultAsset)) + // 注意:只对非原生文件收集器处理 + if(PackRuleName != nameof(PackRawFile)) { - UnityEngine.Debug.LogWarning($"Cannot pack default asset : {assetPath}"); - return false; + if (type == typeof(UnityEditor.DefaultAsset)) + { + UnityEngine.Debug.LogWarning($"Cannot pack default asset : {assetPath}"); + return false; + } } - */ string fileExtension = System.IO.Path.GetExtension(assetPath); if (IsIgnoreFile(fileExtension))