Hi everyone,
I’ve a script for downloading assetbundle that works fine but I’d like to show the progress in term of size (Kb).
I use this code:
WWW download = WWW.LoadFromCacheOrDownload(assetURL, m_Version)
myProgressBar.Progress = download.Progress;
And I show this: (myProgressBar.Progress * 100) + "%";
That’s fine but if I want to show the size (and not the %) from the “download” object by using download.Size.
But I’ve got this error when I use it:
WWWCached data can only be accessed using the assetBundle property!
UnityEngine.WWW:get_size()
So I’ve tried another way that cause the same error
WWW download = WWW.LoadFromCacheOrDownload(assetURL, m_Version)
while (!download.isDone)
{
progressBar.Progress = (int)(download.bytesDownloaded / 1000);
progressBar.AssetSize = (int)((1 / download.progress) * progressBar.Progress);
}
I didn’t understand how you can’t have the size and the downloaded size if you have the progress property… Progress is normaly the Size divided by the bytesDownloaded , no ?!
Has someone found a solution ?