mirror of https://github.com/tuyoogame/YooAsset
Compare commits
2 Commits
e31799e78b
...
9b4abf86b6
Author | SHA1 | Date |
---|---|---|
|
9b4abf86b6 | |
|
0331b7b6e3 |
|
@ -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
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace YooAsset.Editor
|
|||
{
|
||||
string IAddressRule.GetAssetAddress(AddressRuleData data)
|
||||
{
|
||||
return data.AssetPath;
|
||||
throw new System.Exception("可寻址模式下已经默认支持通过资源路径加载!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace YooAsset
|
|||
Manifest.AssetDic = new Dictionary<string, PackageAsset>(_packageAssetCount);
|
||||
|
||||
if (Manifest.EnableAddressable)
|
||||
Manifest.AssetPathMapping1 = new Dictionary<string, string>(_packageAssetCount);
|
||||
Manifest.AssetPathMapping1 = new Dictionary<string, string>(_packageAssetCount * 3);
|
||||
else
|
||||
Manifest.AssetPathMapping1 = new Dictionary<string, string>(_packageAssetCount * 2);
|
||||
|
||||
|
@ -130,15 +130,6 @@ namespace YooAsset
|
|||
Manifest.AssetDic.Add(assetPath, packageAsset);
|
||||
|
||||
// 填充AssetPathMapping1
|
||||
if (Manifest.EnableAddressable)
|
||||
{
|
||||
string location = packageAsset.Address;
|
||||
if (Manifest.AssetPathMapping1.ContainsKey(location))
|
||||
throw new System.Exception($"Address have existed : {location}");
|
||||
else
|
||||
Manifest.AssetPathMapping1.Add(location, packageAsset.AssetPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
string location = packageAsset.AssetPath;
|
||||
if (Manifest.LocationToLower)
|
||||
|
@ -146,7 +137,7 @@ namespace YooAsset
|
|||
|
||||
// 添加原生路径的映射
|
||||
if (Manifest.AssetPathMapping1.ContainsKey(location))
|
||||
throw new System.Exception($"AssetPath have existed : {location}");
|
||||
throw new System.Exception($"Location have existed : {location}");
|
||||
else
|
||||
Manifest.AssetPathMapping1.Add(location, packageAsset.AssetPath);
|
||||
|
||||
|
@ -155,11 +146,19 @@ namespace YooAsset
|
|||
{
|
||||
string locationWithoutExtension = PathUtility.RemoveExtension(location);
|
||||
if (Manifest.AssetPathMapping1.ContainsKey(locationWithoutExtension))
|
||||
YooLogger.Warning($"AssetPath have existed : {locationWithoutExtension}");
|
||||
YooLogger.Warning($"Location have existed : {locationWithoutExtension}");
|
||||
else
|
||||
Manifest.AssetPathMapping1.Add(locationWithoutExtension, packageAsset.AssetPath);
|
||||
}
|
||||
}
|
||||
if (Manifest.EnableAddressable)
|
||||
{
|
||||
string location = packageAsset.Address;
|
||||
if (Manifest.AssetPathMapping1.ContainsKey(location))
|
||||
throw new System.Exception($"Location have existed : {location}");
|
||||
else
|
||||
Manifest.AssetPathMapping1.Add(location, packageAsset.AssetPath);
|
||||
}
|
||||
|
||||
// 填充AssetPathMapping2
|
||||
if (Manifest.IncludeAssetGUID)
|
||||
|
|
Loading…
Reference in New Issue