Hi, I am using Unity 2019.2 and previously using Addressables 1.16.15.
I decide to update to 1.17.5 because of the cache clear behavior option and it is great.
I am using the same code on 1.16.15 and 1.17.5 :
downloadHandle = Addressables.DownloadDependenciesAsync(everyKey);
while (!downloadHandle.IsDone)
{
DownloadStatus status = downloadHandle.GetDownloadStatus();
OnDownloading?.Invoke(status.Percent, status.TotalBytes);
yield return null;
}
1.16.15 works fine but 1.17.5. not.
In 1.17.5, the DownloadedBytes in status was 0, result in the percent is also 0.
I have tried downloadHandle.PercentComplete, and it is also returning 0.
But all the bundles can be downloaded and loaded.
Try using “status.DownloadedBytes”
this works for me.
But I am using Unity 2020.2.
I recognized that “status.TotalBytes” is the size of the current bundle that is downloaded. So if “everyKey” refers to multiple bundles to download, that value will change during the download.
Thanks for the reply.
Both status.DownloadedBytes / status.Percent / downloadHandle.PercentComplete are returning 0 to me.
It is weird because these line of codes work fine at Addressable v1.16.15, so it may be a bug from Addressable.
status.TotalBytes is fine, it is always the total size of bundles from keys, nothing changed.
After testing with latest version (1.17.13), I guess the problem is still existed. Here is my log after added this line of code in my while() loop at #1 :
downloadHandle is a AsyncOperationHandle status is from downloadHandle.GetDownloadStatus()
In this scenario, I have 3 bundles to download, and it seems that those download status values will only changed after completing a download operation of each bundle.
Oh. I was right about it being fixed, but wrong about the fix being included in Addressables 1.17.13.
We actually missed some use-cases in our first attempt at fixing this. It should work correctly in version 1.17.15+. I just tested your exact use case and all numbers seem correct.
Apologies for the inconveniences, if any.
As always, don’t hesitate if there’s anything else.