dim*_*yak 5 ios ios9 on-demand-resources app-thinning
我正在尝试在不使用xcassets的游戏中使用ODR.
所以,我有一个带有标签的纹理(例如"教程"),在项目设置中将其作为ODR并使用下面的代码获取它:
NSBundleResourceRequest *resourceRequest = [[NSBundleResourceRequest alloc] initWithTags:tags];
[resourceRequest conditionallyBeginAccessingResourcesWithCompletionHandler:^(BOOL resourcesAvailable) {
if (resourcesAvailable) {
// Upload the texture
}
else
{
[resourceRequest beginAccessingResourcesWithCompletionHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Failed to load assets pack");
}
else
{
// Upload the texture
}
}];
}
}];
Run Code Online (Sandbox Code Playgroud)
主包不包含有问题的纹理(我在模拟器文件夹中查看了包).调用上面的代码后,XCode和日志报告它已成功下载并准备使用.
注释的// Upload the texture位置我需要调用我的代码将纹理上传到视频内存,但问题是 - 我无法获得下载文件的确切位置.
有没有办法知道下载资产的位置?
| 归档时间: |
|
| 查看次数: |
1072 次 |
| 最近记录: |