mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-28 11:38:47 +00:00
Update runtime code
This commit is contained in:
@@ -27,5 +27,10 @@ namespace YooAsset
|
||||
/// 映射为资源路径
|
||||
/// </summary>
|
||||
string MappingToAssetPath(string location);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所属的包裹名
|
||||
/// </summary>
|
||||
string GetPackageName();
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ namespace YooAsset
|
||||
/// <summary>
|
||||
/// 定位地址转换为资源路径
|
||||
/// </summary>
|
||||
string ConvertLocationToAssetPath(string location);
|
||||
string ConvertLocationToAssetPath(YooAssetPackage package, string location);
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,9 @@ namespace YooAsset
|
||||
{
|
||||
public class AddressLocationServices : ILocationServices
|
||||
{
|
||||
string ILocationServices.ConvertLocationToAssetPath(string location)
|
||||
string ILocationServices.ConvertLocationToAssetPath(YooAssetPackage package, string location)
|
||||
{
|
||||
return YooAssets.MappingToAssetPath(location);
|
||||
return package.MappingToAssetPath(location);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,16 +11,16 @@ namespace YooAsset
|
||||
_resourceRoot = PathHelper.GetRegularPath(resourceRoot);
|
||||
}
|
||||
|
||||
string ILocationServices.ConvertLocationToAssetPath(string location)
|
||||
string ILocationServices.ConvertLocationToAssetPath(YooAssetPackage package, string location)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_resourceRoot))
|
||||
{
|
||||
return YooAssets.MappingToAssetPath(location);
|
||||
return package.MappingToAssetPath(location);
|
||||
}
|
||||
else
|
||||
{
|
||||
string tempLocation = $"{_resourceRoot}/{location}";
|
||||
return YooAssets.MappingToAssetPath(tempLocation);
|
||||
return package.MappingToAssetPath(tempLocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user