Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Addressables - Always the answer?

Discussion in 'Scripting' started by andrew210, Sep 28, 2021.

  1. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    241
    I've taken a few looks into moving from Asset Bundles to Addressables over the past couple of years but I still can't see how its the way to go for every situation.

    In my case, I have a bundle of bitmaps that can be combined/blended in a number of complex ways, right now I download the "bitmaps" bundle before hand, if this hasn't downloaded I just do a failover quick draw of a default graphic, if it has downloaded i can create any of my textures synchronously with no fears.

    Am I misunderstanding Addressables? Say if I want to combine 20 of these bitmaps as addressables, I have to asynchronously load each image with AsyncOperationHandle (I know this can be synchronously completed with https://docs.unity3d.com/Packages/com.unity.addressables@1.17/manual/SynchronousAddressables.html this). But I would need a way to pre-download all of these before even thinking about trying to call these (like I can with asset bundles) and avoid a way of adding "negligible" overheads to things that need to be optimized as far as is possible.

    Is there a way to do these things with Addressables? It seems more and more assets take advantage of addressables and where things can be asynchronous it seems like a great tool, but I'm having some trouble understanding why in my case it would be beneficial over asset bundles.
     
  2. Rotary-Heart

    Rotary-Heart

    Joined:
    Dec 18, 2012
    Posts:
    813
    You can pre-download your group (bundle) (where you have your bitmaps) so that it is stored in the cache: Look at Addressables.DownloadDependenciesAsync then any load request to any asset of that group will not have the overhead of downloading the bundle, note that at the bottom of the documentation there is a cache limitation for some platforms.

    If you don't want to load each image individually (after pre-downloading) you can use labels to load them all. Also, this kind of questions will definitely get more answers in the Addressables section
     
    andrew210 and Kurt-Dekker like this.
  3. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    241
    Thank you so much and also thank you for the direction to the appropriate place! I'll take another shot today at this
     
  4. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Keep in mind that Addressables use asset bundles under the hood, so technically you are still using asset bundles.
     
    andrew210 likes this.