From 256844ddf5f8bfa2bcaec1081faa061b0192b5a7 Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 12 Jul 2022 15:38:26 +0800 Subject: [PATCH] Update AssetBundleCollector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 打包资源忽略Gizmos资源文件。 --- .../Editor/AssetBundleBuilder/BuildAssetInfo.cs | 13 +++++-------- .../AssetBundleCollector/AssetBundleCollector.cs | 8 ++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildAssetInfo.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildAssetInfo.cs index d9c90e3..b106394 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildAssetInfo.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildAssetInfo.cs @@ -112,7 +112,7 @@ namespace YooAsset.Editor } } } - + /// /// 添加资源包的分类标签 /// 说明:传染算法统计到的分类标签 @@ -185,13 +185,10 @@ namespace YooAsset.Editor if (_referenceBundleNames.Count > 1) { - if (!AssetPath.Contains("/Editor/") && !AssetPath.Contains("/Gizmos/")) - { - IPackRule packRule = PackDirectory.StaticPackRule; - var bundleName = packRule.GetBundleName(new PackRuleData(AssetPath)); - var shareBundleName = $"share_{bundleName}.{YooAssetSettingsData.Setting.AssetBundleFileVariant}"; - _shareBundleName = EditorTools.GetRegularPath(shareBundleName).ToLower(); - } + IPackRule packRule = PackDirectory.StaticPackRule; + var bundleName = packRule.GetBundleName(new PackRuleData(AssetPath)); + var shareBundleName = $"share_{bundleName}.{YooAssetSettingsData.Setting.AssetBundleFileVariant}"; + _shareBundleName = EditorTools.GetRegularPath(shareBundleName).ToLower(); } } else diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index e09aee2..2bd27d3 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -180,7 +180,15 @@ namespace YooAsset.Editor private bool IsValidateAsset(string assetPath) { if (assetPath.StartsWith("Assets/") == false && assetPath.StartsWith("Packages/") == false) + { + UnityEngine.Debug.LogError($"Invalid asset path : {assetPath}"); return false; + } + if (assetPath.Contains("/Gizmos/")) + { + UnityEngine.Debug.LogWarning($"Cannot pack gizmos asset : {assetPath}"); + return false; + } if (AssetDatabase.IsValidFolder(assetPath)) return false;