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

How to get Addressables Asset Entry dependencies

Discussion in 'Addressables' started by Steimond1, Nov 29, 2021.

  1. Steimond1

    Steimond1

    Joined:
    Jan 20, 2021
    Posts:
    12
    Hello everybody! I'm making my own analyze rule for an addressables analyze and I'm stuck...

    I have 2 different types of groups.
    One type is local groups that contain assets that are included in the build after packaging.
    The second type is remote groups that contain scenes and assets that will be downloaded from the server.
    I suspect that there are assets in local groups that are needed only in remote groups and it makes no sense to leave them in the build as they take up memory.
    So, my rule must take each asset and watch its dependencies, and if the dependencies will only lead to remote groups, then move this asset to the remote group.

    And that’s the question. How to get all dependencies of an asset in addressables?
     
  2. JelteS

    JelteS

    Joined:
    Jan 30, 2018
    Posts:
    16
  3. Steimond1

    Steimond1

    Joined:
    Jan 20, 2021
    Posts:
    12
    Yeah, I know about build layout report. I saw threads about that and I tried that https://forum.unity.com/threads/addressables-buildlayout-explorer-for-unity.1162418/

    This is probably the same thing you are working on :)

    But there might be an easier way to find dependencies. Thanks for the answer anyway!
     
  4. JelteS

    JelteS

    Joined:
    Jan 30, 2018
    Posts:
    16
    yea, sadly buildlayout explorer didn't give me the info that I needed. It lacks info on which files are causing the dependencies between the bundles and only uses the extended dependencies, which in the project I'm working on are like 250+. rather than the 5 to 10 I'd expect (a lot of cascading dependencies, which I'm trying to reduce now)
     
  5. Steimond1

    Steimond1

    Joined:
    Jan 20, 2021
    Posts:
    12
    So I created a test case. I placed a test game object on a remote scene and made that object addressable. Then I put this addressable object in the default (not remote) group. In the end, I have 1 game object that is only needed in the remote scene and included in the non-remote bundle...and...nothing! At all...
    The build layout report can only tell that this game object is included in the default group bundle. This game object is not included in my remote scene set.
    I have run out of variants for how to find these dependencies...
    Any suggestions?
     
  6. gsylvain

    gsylvain

    Joined:
    Aug 6, 2014
    Posts:
    96
    If you ever encounter that problematic, checkout a temporary branch and set the bundle mode of all your groups to "pack separately" and rebuild your addressables. You'll get a much clearer picture with buildlayout-explorer. Also, try browsing buildlayout.txt in any good text editor. It gives a tiny bit more informations than what is displayed in buildlayout-explorer. For instance, search the string "group [your_group_name]"

    I hope this help for your future projects!
     
    Steimond1 likes this.