Hello,
I'm currently trying to export and import assetBundle that contains a scene. I'm trying to access the hash in order to use *WWW.LoadFromCacheOrDownload (String url, Hash128 hash)* as checking if I should download a new bundle on the server or not.
Unfortunately, I can't get the assetBundleManifest from the assetBundle, which should give me the hash I need to compare the versions of the bundles in cache or online.
//Download assetBundle via WWW
WWW wwwManifest = new WWW (path);
yield return wwwManifest;
//get the manifest
AssetBundle manifestBundle = wwwManifest.assetBundle;
AssetBundleManifest manifest = manifestBundle.LoadAsset ("AssetBundleManifest") as AssetBundleManifest; //Fails because my bundle is a scene
//Get The hash
Hash128 hash = manifest.GetAssetBundleHash (bundleName);
//Get the last bundle from hash
WWW www = WWW.LoadFromCacheOrDownload (path, hash))
Apparently, I can't use LoadAsset () on a streamed scene assetBundle. Maybe I'm doing something wrong. I just want to load the newest scene bundle, if I use *WWW.LoadFromCacheOrDownload (String url, int version)*, it always get the one from the cache.
Can someone help me out with this? Or at least explains me how it exactly works, because I'm a bit lost and I don't understand everything about assetbundles.
Thank you,
Antoine.
↧