Update runtime code

This commit is contained in:
hevinci
2022-09-29 18:40:43 +08:00
parent 46c219505f
commit a71921cdd1
36 changed files with 844 additions and 1625 deletions

View File

@@ -27,5 +27,10 @@ namespace YooAsset
/// 映射为资源路径
/// </summary>
string MappingToAssetPath(string location);
/// <summary>
/// 获取所属的包裹名
/// </summary>
string GetPackageName();
}
}

View File

@@ -6,6 +6,6 @@ namespace YooAsset
/// <summary>
/// 定位地址转换为资源路径
/// </summary>
string ConvertLocationToAssetPath(string location);
string ConvertLocationToAssetPath(YooAssetPackage package, string location);
}
}

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}
}