diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index b344a42..5fe9474 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -197,16 +197,17 @@ namespace YooAsset.Editor // 检测可寻址地址是否重复 if (command.EnableAddressable) { - HashSet adressTemper = new HashSet(); + var addressTemper = new Dictionary(); foreach (var collectInfoPair in result) { if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector) { string address = collectInfoPair.Value.Address; - if (adressTemper.Contains(address) == false) - adressTemper.Add(address); + string assetPath = collectInfoPair.Value.AssetPath; + if (addressTemper.TryGetValue(address, out var existed) == false) + addressTemper.Add(address, assetPath); else - throw new Exception($"The address is existed : {address} in collector : {CollectPath}"); + throw new Exception($"The address is existed : {address} in collector : {CollectPath}.\nAssetPath:\n {existed}\n {assetPath}"); } } } diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorGroup.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorGroup.cs index 0575619..8ae3037 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorGroup.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorGroup.cs @@ -96,16 +96,17 @@ namespace YooAsset.Editor // 检测可寻址地址是否重复 if (command.EnableAddressable) { - HashSet adressTemper = new HashSet(); + var addressTemper = new Dictionary(); foreach (var collectInfoPair in result) { if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector) { string address = collectInfoPair.Value.Address; - if (adressTemper.Contains(address) == false) - adressTemper.Add(address); + string assetPath = collectInfoPair.Value.AssetPath; + if (addressTemper.TryGetValue(address, out var existed) == false) + addressTemper.Add(address, assetPath); else - throw new Exception($"The address is existed : {address} in group : {GroupName}"); + throw new Exception($"The address is existed : {address} in group : {GroupName}.\nAssetPath:\n{existed}\n{assetPath}"); } } } diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorPackage.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorPackage.cs index df6a8f2..a912c1c 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorPackage.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorPackage.cs @@ -76,16 +76,17 @@ namespace YooAsset.Editor // 检测可寻址地址是否重复 if (command.EnableAddressable) { - HashSet adressTemper = new HashSet(); + var addressTemper = new Dictionary(); foreach (var collectInfoPair in result) { if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector) { string address = collectInfoPair.Value.Address; - if (adressTemper.Contains(address) == false) - adressTemper.Add(address); + string assetPath = collectInfoPair.Value.AssetPath; + if (addressTemper.TryGetValue(address, out var existed) == false) + addressTemper.Add(address, assetPath); else - throw new Exception($"The address is existed : {address}"); + throw new Exception($"The address is existed : {address}.\nAssetPath:\n {existed}\n {assetPath}"); } } }