Search Unity

How addressables deals with dependencies

Discussion in 'Addressables' started by Uli_Okm, Sep 30, 2019.

  1. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    95
    Hello, I am currently adding Adressables to my project. But have one question:
    How addressables deals with the dependencies?
    My use case: I am adding prefabs to the addressables list. When I am doing this, Unity will automatically make the meshes, textures used by this prefab into addressables also (if they are not used in other places), or will Unity just generate the bundle with the prefab file but the meshes and textures will still be in the normal build (and the correct way would be to also add the dependencies as addressables assets)?

    Thanks
     
    Last edited: Sep 30, 2019
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Dependencies will be handled automatically, and added to the asset bundle.

    If two prefabs reference same asset, but been placed at two bundles (for example, via two addressable groups), the asset will be duplicated (existing in both bundles).

    Tips: use AssetBundle Browser to inspect the generate asset bundles.
    upload_2019-10-3_12-8-50.png
     
  3. Sylker

    Sylker

    Joined:
    Sep 22, 2012
    Posts:
    22
    I don't think @Uli_Okm is talking about Asset Bundles. I'm having the same doubts about how Addressables are handling the dependencies.

    I am assuming Unity does handle dependencies automatically. I created a group with prefabs only, built it and the resulted bundle came with 40 Mb. Pretty heavy for prefabs only.



     
    Last edited: Aug 5, 2020
  4. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    392
    Well ye all dependencies of the prefab get added implicitly, you can check this with the analyze tool.
    So all textures, models of the prefab are in the bundle.

    What you can do next is split those static/larger assets in another bundle so that your prefab is just a few KB and you can change and update that without downloading the 40 MB each time.