How to check status of Addressables (Downloaded/Cached/None)

I try to find the correct way to check is Addressable Asset have been downloaded to my local storage and if it is loaded to cache (separated checks) or not.
At the moment the only answer I have found in the forums is to use Addressables.GetDownloadSize(AddressableScene) and if it returns 0 than it means that it was downloaded (…?)
When tested it was inconsistent on Mobile device and in Editor.

Thanks in advance !

You have to rely on GetDownloadSize, 0 means nothing to download (== downloaded / cached). It resolves the dependencies for you. If you find the api is inconsistent between android and editor, please report a bug to unity.

2 Likes

Thanks !
And just to be sure, this is the intended solution or is it a temp solution until Unity implement a different API for it ?

I don’t remember there’s discussion about adding new api for such purpose. But you can propose RFC if you think it’s better to have it.

2 Likes

In Addressables 1.11.2, Addressables.GetDownloadSizeAsync(key) always return the actual file size even if the asset has been downloaded. I am trying to find an alternative way to check if an asset has been downloaded and cached. Caching.IsVersionCached(key, new Hash128()); may does the thing, but its second parameter requires the hash code of the bundle, I don’t know how to get the hash code. Can anyone help?

1 Like

This is clearly a bug. Can you send a bug report via Unity bug reporter? I’m relying on this behaviour for some loading logic. Now I’m hesitant to update to the latest version :frowning:

Has anyone reported this as an issue in the meantime? If not, I’ll do so tomorrow.

I didn’t. Please do. They’ve released another update but no mention about this issue being fixed. Very sad. Not only the whole Download Bundles feature is half-baked, but now they break it completely and ignore the reports on forums… I wonder if they have a dedicated team working just on Addressables alone, how hard it is to take a peek at forums once in a while to see what issues people find and what they are struggling with.

These are still early days of Addressables and it’s important to gather as much info as possible before doing 2.0. Yet there’s no signs of devs here :frowning:

I’ve reported case 1264020 and will post here when I receive a reply.

3 Likes

My case was a duplicate of: Unity Issue Tracker - Addressables.GetDownloadSizeAsync returns greater than zero values when the bundles are cached

3 Likes