From b5be5b60da5538fdec0ca3ae1eca34126fa0f082 Mon Sep 17 00:00:00 2001 From: hevinci Date: Mon, 15 Aug 2022 10:29:28 +0800 Subject: [PATCH] Update DefaultPackRule.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了默认的打包规则 --- .../Editor/AssetBundleCollector/DefaultPackRule.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultPackRule.cs b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultPackRule.cs index bd34ff3..00a067b 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultPackRule.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultPackRule.cs @@ -15,7 +15,8 @@ namespace YooAsset.Editor { string IPackRule.GetBundleName(PackRuleData data) { - return StringUtility.RemoveExtension(data.AssetPath); + string bundleName = StringUtility.RemoveExtension(data.AssetPath); + return EditorTools.GetRegularPath(bundleName).Replace('/', '_'); } } @@ -32,7 +33,8 @@ namespace YooAsset.Editor string IPackRule.GetBundleName(PackRuleData data) { - return Path.GetDirectoryName(data.AssetPath); + string bundleName = Path.GetDirectoryName(data.AssetPath); + return EditorTools.GetRegularPath(bundleName).Replace('/', '_'); } } @@ -55,7 +57,7 @@ namespace YooAsset.Editor if (Path.HasExtension(splits[0])) throw new Exception($"Not found root directory : {assetPath}"); string bundleName = $"{data.CollectPath}/{splits[0]}"; - return bundleName; + return EditorTools.GetRegularPath(bundleName).Replace('/', '_'); } else { @@ -72,7 +74,8 @@ namespace YooAsset.Editor { string IPackRule.GetBundleName(PackRuleData data) { - return StringUtility.RemoveExtension(data.CollectPath); + string bundleName = StringUtility.RemoveExtension(data.CollectPath); + return EditorTools.GetRegularPath(bundleName).Replace('/', '_'); } } @@ -110,7 +113,8 @@ namespace YooAsset.Editor if (depends.Length != 1) throw new Exception($"{nameof(PackRawFile)} is not support estension : {extension}"); - return StringUtility.RemoveExtension(data.AssetPath); + string bundleName = StringUtility.RemoveExtension(data.AssetPath); + return EditorTools.GetRegularPath(bundleName).Replace('/', '_'); } }