If i mark all assets as remote assets?
How to pre-download when user opens the game first time?
What I did was tag (one/some) assets in each bundle I want predownloaded and use
Addressables.DownloadDependenciesAsync("default");
during loading.
you can use the AsyncOperationHandle to show a download/loading bar.
Thank you!
I willl have a try then.
The document is so simple though the addresables is a complex system!
What if we do not want to tag all of our assets as ‘default’ for the sake of being able to download them? There must be a function to just a ‘download all missing data’?
DownloadDependenciesAsync() can take a list of keys as parameters. you can get all keys from your catalog with the function Addressables.ResourceLocators.SelectMany(x => x.Keys).ToList();
and pass that to DownloadDependenciesAsync to download everything. passing keys of things that are already cached will just result in a no-op. Bonus: you can also pass your list of all keys to Addressables.GetDownloadSizeAsync() which will return you how many bytes DownloadDependenciesAsync will need to download (will be 0 if everything is cached already)