- Home /
WWW.LoadFromCacheOrDownload AssetBundle Size
Hello, So I've successfully downloaded the assetbundle, but now I'm trying to show the size that was downloaded. I usually use the WWW w = new WWW("Link")
and there after use w.size
to get the downloaded size, but that doesn't seem to work when using WWW.LoadFromCacheOrDownload
. I got the error, "WWWCached data can only be accessed using the assetBundle property!"
Now there doesn't appear to be a function for AssetBundle.Size.
I've done a bit of looking around and the best I came up with was this website but it looks a lot more complicated than i think it should be. Any help would be much appreciated.
Answer by Dreamora · Apr 29, 2017 at 07:36 PM
The problem is that LoadFromCacheOrDownload does different things depending on it being downloading or loading from cache. The asset bundles that get stored in cache are decompressed, which makes it technically impossible to get their compressed size, which is what www.size is expected to provide.
The more complicated way you found is the only way I am aware of, basically because it by force redownloads the compressed asset bundle.
What are you trying to use it for, or why is the absolute size relevant vs knowing if it is still loading or done?
Basically all I want to do is say, this is how big the thing you downloaded was. I don't need to know how big it is before downloading. It's usually very small like 15 kb but I wanted the user to see how much it added up at the end of the month.
I use the Caching.IsVersionCached
to deter$$anonymous$$e if it is cached and if it was cached, then it displays that nothing was downloaded as they have the latest version already. Thanks though. I think I'm gonna go with saying it was an estimated download of X, $$anonymous$$B.
Your answer
Follow this Question
Related Questions
What's the matter downloading with 3G 0 Answers
What is WWW.size? 0 Answers
Download assetBundle from server 2 Answers
WWW.progress doesn't work 1 Answer
Cannot load cached AssetBundle 1 Answer