From 56d915936ed250d19cbf581c53d72dde520ca44b Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 9 Aug 2023 20:15:33 +0800 Subject: [PATCH] update editor code --- .../Editor/AssetBundleCollector/AssetBundleCollector.cs | 4 ++++ .../AssetBundleCollector/DefaultRules/DefaultAddressRule.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index d0e9803..e0b19ed 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -204,6 +204,10 @@ namespace YooAsset.Editor { string address = collectInfoPair.Value.Address; string assetPath = collectInfoPair.Value.AssetPath; + + if (address.StartsWith("Assets/") || address.StartsWith("assets/")) + throw new Exception($"The address can not set asset path in collector : {CollectPath} \nAssetPath: {assetPath}"); + if (addressTemper.TryGetValue(address, out var existed) == false) addressTemper.Add(address, assetPath); else diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultAddressRule.cs b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultAddressRule.cs index 851bf7a..8cde379 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultAddressRule.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultAddressRule.cs @@ -16,7 +16,7 @@ namespace YooAsset.Editor { string IAddressRule.GetAssetAddress(AddressRuleData data) { - return data.AssetPath; + throw new System.Exception("可寻址模式下已经默认支持通过资源路径加载!"); } }