AssetBundle Caching Process. What happens when a Unity asset bundle is cached? What properties of an assetbundle make it different from its cached form?
This is probably a very niche question, but what are the specific differences between an asset bundle and a cached bundle for the asset bundle system that Unity 4 used? I'm curious how cached files differ to asset bundles and what, if any, different properties change from both types of files? I.E. What happens to asset bundles when they are cached through WWW.LoadFromCacheOrDownload
?
Unity unfortunately doesn't have this process documented as the C# code calls an internal function called INTERNAL_CALL_WWW(this, url, ref hash, crc)
, which is given the instance of WWW, the string of the URL, a Hash128 and a UINT called crc with a default value of 0. (Referenced decompiled 5.3.2p2 code).
The Unity 2017 code leads to the private extern static IntPtr CreateCached(DownloadHandlerAssetBundle obj, string url, string name, Hash128 hash, uint crc);
external method, which isn't documented either. (2017+ code is on the official Unity GitHub, but seems to differ from Unity 2015 code).
Furthermore, what actually happens when an asset bundle is cached so that the engine can recognise the file is in cache and doesn't need to be downloaded? Is it just simply that it searches for the hashed name in the cache, or does it do something more intricate?
Frostrix