diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index f168f0f..4810460 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -204,6 +204,8 @@ namespace YooAsset.Editor { string address = collectInfoPair.Value.Address; string assetPath = collectInfoPair.Value.AssetPath; + if (string.IsNullOrEmpty(address)) + continue; if (address.StartsWith("Assets/") || address.StartsWith("assets/")) throw new Exception($"The address can not set asset path in collector : {CollectPath} \nAssetPath: {assetPath}"); diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorGroup.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorGroup.cs index 92bd97b..0468cdb 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorGroup.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorGroup.cs @@ -106,6 +106,9 @@ namespace YooAsset.Editor { string address = collectInfoPair.Value.Address; string assetPath = collectInfoPair.Value.AssetPath; + if (string.IsNullOrEmpty(address)) + continue; + if (addressTemper.TryGetValue(address, out var existed) == false) addressTemper.Add(address, assetPath); else diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorPackage.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorPackage.cs index 694dbc5..3f36872 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorPackage.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorPackage.cs @@ -83,6 +83,9 @@ namespace YooAsset.Editor { string address = collectInfoPair.Value.Address; string assetPath = collectInfoPair.Value.AssetPath; + if (string.IsNullOrEmpty(address)) + continue; + if (addressTemper.TryGetValue(address, out var existed) == false) addressTemper.Add(address, assetPath); else diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs index b29684c..ccde313 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs @@ -94,7 +94,8 @@ namespace YooAsset.Editor typeof(AddressByFileName), typeof(AddressByFilePath), typeof(AddressByFolderAndFileName), - typeof(AddressByGroupAndFileName) + typeof(AddressByGroupAndFileName), + typeof(AddressDisable) }; var customTypes = EditorTools.GetAssignableTypes(typeof(IAddressRule)); diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultAddressRule.cs b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultAddressRule.cs index 8cde379..0a32e81 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultAddressRule.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultAddressRule.cs @@ -2,6 +2,15 @@ namespace YooAsset.Editor { + [DisplayName("定位地址: 禁用")] + public class AddressDisable : IAddressRule + { + string IAddressRule.GetAssetAddress(AddressRuleData data) + { + return string.Empty; + } + } + [DisplayName("定位地址: 文件名")] public class AddressByFileName : IAddressRule {