- Home /
Will assetbundle automaticly load instead of download if its already present on the device
so i want to be able to download entire scenes into my app (i will call it dlc for now), assetbundles seemed to be the way to go but i am not sure how unity handles assetbundles right now i'm considering the following approach.
public void loadLevel ()
{
//checking if the scene is already loaded
if (sceneName.isloaded){
//feedbackloop
}
else{
//checking if the assetbundle is downloaded on the device
if ( "no clue to what i should put in here"){
//load scene
}
else{
//download assetbundle
//load scene
{
}
}
Answer by elenzil · Oct 06, 2016 at 10:32 PM
WWW.LoadFromCacheOrDownload might be helpful.
im not sure how the caching works, Does it cache it only for 1 session or does it delete the assetBundle when you force quit the app.
hm, the docs are not explicit, but all the talk about the cache being on disk, deleting old cache files, etc, strongly suggests to me that the cache will survive across sessions. plus it would be crazy to design it otherwise.
if you want to 'bust' the cache, ie force a re-download, it looks like you would bump the version #.
the Caching class has a bunch of interesting functionality as well. crazy that it's not marked as "See Also" at the bottom of LoadFromCacheOrDownload.
thanks for replying! too bad the unity docs are lacking. I'm going to try some stuff next week. Let's hope it all works out XD.
Your answer
![](https://koobas.hobune.stream/wayback/20220612094120im_/https://answers.unity.com/themes/thub/images/avi.jpg)