mirror of https://github.com/tuyoogame/YooAsset
可寻址模式下支持全路径加载资源
parent
fbbf762e70
commit
c099517a4d
|
@ -84,25 +84,17 @@ namespace YooAsset
|
|||
{
|
||||
if (locationToLower)
|
||||
YooLogger.Error("Addressable not support location to lower !");
|
||||
|
||||
foreach (var patchAsset in AssetList)
|
||||
{
|
||||
string location = patchAsset.Address;
|
||||
if (AssetPathMapping.ContainsKey(location))
|
||||
throw new Exception($"Address have existed : {location}");
|
||||
else
|
||||
AssetPathMapping.Add(location, patchAsset.AssetPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_locationToLower = locationToLower;
|
||||
}
|
||||
|
||||
foreach(var patchAsset in AssetList)
|
||||
{
|
||||
string location = patchAsset.AssetPath;
|
||||
if(locationToLower)
|
||||
location = location.ToLower();
|
||||
|
||||
// 添加原生路径的映射
|
||||
if(AssetPathMapping.ContainsKey(location))
|
||||
throw new Exception($"AssetPath have existed : {location}");
|
||||
|
@ -118,8 +110,18 @@ namespace YooAsset
|
|||
else
|
||||
AssetPathMapping.Add(locationWithoutExtension, patchAsset.AssetPath);
|
||||
}
|
||||
// 可寻址路径映射
|
||||
if(EnableAddressable)
|
||||
{
|
||||
// 可寻址路径
|
||||
location = patchAsset.Address;
|
||||
if(AssetPathMapping.ContainsKey(location))
|
||||
throw new Exception($"Address have existed : {location}");
|
||||
else
|
||||
AssetPathMapping.Add(location, patchAsset.AssetPath);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue