Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Download AssetBundles via Addressable

Discussion in 'Scripting' started by UnityCuriousGeorge, Jan 4, 2021.

  1. UnityCuriousGeorge

    UnityCuriousGeorge

    Joined:
    Oct 14, 2020
    Posts:
    3
    Hello,
    I'm learning Addressable system and want create simple app that will be downloading bundles at the start of the application. For this purpose I suppose to receive from server side list of bundles and call to AssetBundle download.
    Is it possible to use in my case Addressables system when I don't know asset key but know bundle name, path?

    Thanks.
     
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    if you know the bundle path, you might as well just use UnityWebRequest. The addressable layer is meant to deal with the scenario where you want those details abstracted.

    That being said, Addressables can download things up front. You could either do that by giving everything a label, or using the locator to get the .keys property (this second option is much more complex, and not recommended unless you want to get very familiar with our interfaces).

    Alternatively you could use addressables for building and loading, but use direct UnityWebRequest to download the bundles in advance (using some other mechanism to gain the list of bundles). Addressables will check the bundle cache before downloading, so would utilize what you downloaded outside addressables.
     
    UnityCuriousGeorge likes this.
  3. icandoapp

    icandoapp

    Joined:
    Oct 4, 2018
    Posts:
    1
    Is there any way to handle web request error using Addressables.DownloadDependenciesAsync?