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

Question Can we add addressable groups and content to an existing build?

Discussion in 'Addressables' started by mrbs_vf, Sep 8, 2022.

  1. mrbs_vf

    mrbs_vf

    Joined:
    Mar 16, 2019
    Posts:
    4
    First I start by describing how I want my game to work, then I'll ask my questions. I'm going to make 3 minigames that are entirely independent and isolated from each other, but they might use some scripts or shared meshes and materials that exist in the root of the project.


    The current project structure​

    I want a loader in my main menu to read a list of the minigames that are available (local or remote), then the loader starts retrieving/downloading the bundles, and storing them in the storage, then it adds a button to the main menu to let the user loads the scene of the minigame. So in the end, I want to have a base game that has no minigame with the build, and it gets the minigames from the server (like a DLC) and adds and registers the content.

    but here's the thing: Imagine I've published the game with the addressable groups that I showed in the screenshot. then I make a new minigame, build addressables content, and put the files in the server. My question is, how do I tell the game to look for those files and register the paths and content into its addressable settings, without doing a new game build? I want to add a group with its content that is available on the remote server, but I don't know how.

    I've found a snippet of code that adds a group on runtime, but I don't know if it adds the path to the content too. here is the code:
    Code (CSharp):
    1. var settings = UnityEditor.AddressableAssets.AddressableAssetSettingsDefaultObject.Settings;
    2. var group = settings.FindGroup("Group Name");
    3. settings.CreateOrMoveEntry(guid, group);
    Do you have any ideas?
     
  2. lhicks

    lhicks

    Joined:
    Oct 17, 2021
    Posts:
    18
    what you need is the "Remote Catalog" feature from Addressables (near the bottom of this page)
    https://docs.unity3d.com/Packages/com.unity.addressables@1.19/manual/RemoteContentDistribution.html

    The catalog file contains a list of all the available assets and where to find them. By default, Addressables will load this file from an embedded file in the client, but Addressables can also pull this file from a remote source (aka from your server) on initialization, or on request. So the catalog can be update post-launch without having to build a new client. After that, your code just needs to know how to load the new assets. Addressables doesn't have any particular good solutions for this out of the box, so that's pretty much up to you.
     
    mrbs_vf likes this.
  3. mrbs_vf

    mrbs_vf

    Joined:
    Mar 16, 2019
    Posts:
    4
    That's indeed what I need... Thank you so so much!