可寻址地址冲突时,打印冲突地址的资源地址

pull/102/head
hanazonoyurine 2023-04-27 16:30:17 +08:00 committed by GitHub
parent 20b0bd26ae
commit 0f9e932616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 12 deletions

View File

@ -197,16 +197,17 @@ namespace YooAsset.Editor
// 检测可寻址地址是否重复 // 检测可寻址地址是否重复
if (command.EnableAddressable) if (command.EnableAddressable)
{ {
HashSet<string> adressTemper = new HashSet<string>(); var addressTemper = new Dictionary<string, string>();
foreach (var collectInfoPair in result) foreach (var collectInfoPair in result)
{ {
if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector) if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector)
{ {
string address = collectInfoPair.Value.Address; string address = collectInfoPair.Value.Address;
if (adressTemper.Contains(address) == false) string assetPath = collectInfoPair.Value.AssetPath;
adressTemper.Add(address); if (addressTemper.TryGetValue(address, out var existed) == false)
addressTemper.Add(address, assetPath);
else 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}");
} }
} }
} }

View File

@ -96,16 +96,17 @@ namespace YooAsset.Editor
// 检测可寻址地址是否重复 // 检测可寻址地址是否重复
if (command.EnableAddressable) if (command.EnableAddressable)
{ {
HashSet<string> adressTemper = new HashSet<string>(); var addressTemper = new Dictionary<string, string>();
foreach (var collectInfoPair in result) foreach (var collectInfoPair in result)
{ {
if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector) if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector)
{ {
string address = collectInfoPair.Value.Address; string address = collectInfoPair.Value.Address;
if (adressTemper.Contains(address) == false) string assetPath = collectInfoPair.Value.AssetPath;
adressTemper.Add(address); if (addressTemper.TryGetValue(address, out var existed) == false)
addressTemper.Add(address, assetPath);
else 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}");
} }
} }
} }

View File

@ -76,16 +76,17 @@ namespace YooAsset.Editor
// 检测可寻址地址是否重复 // 检测可寻址地址是否重复
if (command.EnableAddressable) if (command.EnableAddressable)
{ {
HashSet<string> adressTemper = new HashSet<string>(); var addressTemper = new Dictionary<string, string>();
foreach (var collectInfoPair in result) foreach (var collectInfoPair in result)
{ {
if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector) if (collectInfoPair.Value.CollectorType == ECollectorType.MainAssetCollector)
{ {
string address = collectInfoPair.Value.Address; string address = collectInfoPair.Value.Address;
if (adressTemper.Contains(address) == false) string assetPath = collectInfoPair.Value.AssetPath;
adressTemper.Add(address); if (addressTemper.TryGetValue(address, out var existed) == false)
addressTemper.Add(address, assetPath);
else else
throw new Exception($"The address is existed : {address}"); throw new Exception($"The address is existed : {address}.\nAssetPath:\n {existed}\n {assetPath}");
} }
} }
} }