string | Url - AssetBundle 的文件名。将自动剔除该字符串中的域和路径信息。 |
int | Version - 要检查的 AssetBundle 的版本号。不允许使用负值。 |
bool
如果以前使用 UnityWebRequestAssetBundle.GetAssetBundle() 加载过匹配 url
和 version
参数的 AssetBundle,并且该 AssetBundle 当前存储在该缓存中,则返回 true。如果 AssetBundle 不在缓存(不管是已将其从缓存中清除还是从未使用缓存 API 加载过它)中,则返回 false。
检查是否缓存了某个 AssetBundle。
使用默认共享缓存时,会自动在 url
参数前插入 WebPlayer 应用程序捆绑包的 URL;这可防止文件名与其他开发人员的 WebPlayer 应用程序使用的同名 AssetBundle 发生冲突。使用专用缓存的 WebPlayer 应用程序不会遇到这种行为。
该函数可用于启用 AssetBundle 预加载。首先,调用 Caching.IsVersionCached() 查看是否已缓存 AssetBundle 的当前版本。如果未缓存 AssetBundle,则可以在后台预加载它,以便在请求时能够立即将其加载到内存中。
5.4.0 及更高版本不支持 Web 播放器。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.