Search Unity

Addressable and content loading

Discussion in 'General Discussion' started by Loden_Heathen, May 12, 2021.

  1. Loden_Heathen

    Loden_Heathen

    Joined:
    Sep 1, 2012
    Posts:
    480
    We have a case we are looking at the Addressable system to solve for.
    In short we want player's to be able to bring in new content they made with the Unity engine.

    I know this sort of use case gets asked a lot but haven't found the answer to this question.

    How do we load an asset from a specific "mod" where we cannot assure the name of the asset is unique but can assue the name of the mod is.

    So here is the use case

    As a modder I need to be able to make new content for the app that can be loaded at run time and not conflict with other assets

    As a developer I have created the tools to insure that the resulting packages get a unique name based on a GUID system however the indavidual assets could have the same name. One key part is the "package manifest" object we have created, this is a common scriptable object that we look for in the package and load up to know what content is in the package and how its meant to be used in the app. We intend to insistt that this object always has the same name e.g. Package Payload so

    Code (CSharp):
    1. var result = Addressables.LoadAssetAsync<PackagePayloadReference>("Package Payload");
    That would load the object we desire however if the user has loaded multiple mods they all have that same name so I assume the first one loaded is what would get pulled and that is not correct.

    How do we insure we are loading the desired Package Payload e.g.

    Code (CSharp):
    1. var result = Addressables.LoadAssetAsync<PackagePayloadReference>("[modId]/Package Payload");
    or

    Code (CSharp):
    1. IResourceLocator modLocator = //load this package;
    2. var result = modLocator.LoadAssetAsync<PackagePayloadReference>("Package Payload");
    TL;DR

    How can I load an asset from a specific addressable package/resource locator where many loaded packages will have an asset by that same name.
     
    Last edited: May 12, 2021
  2. Rotary-Heart

    Rotary-Heart

    Joined:
    Dec 18, 2012
    Posts:
    813
  3. Loden_Heathen

    Loden_Heathen

    Joined:
    Sep 1, 2012
    Posts:
    480
    Thanks but we prefer to create our own, while I refer to it as "modding" that is mostly to save the need to explain the full project here on the forum it would be just as fair to say its a UGC like solution if you have ever worked with Steam Workshop or even a Unity Asset like solution.

    Point is we need to work with Unity Addressable or Unity Content Package directly
     
  4. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,982
    Thats not really an answer, the OP clearly stated their requirements :) Saying "this isnt that but I couldnt get that to work" is not helpful, its basically just thread bloat.

    OP, this is general discussion. Please ask in a relevant forum section and you will likely get the help needed (There is a section dedicated to this).

    @lodendsg https://forum.unity.com/forums/addressables.156/
     
  5. Loden_Heathen

    Loden_Heathen

    Joined:
    Sep 1, 2012
    Posts:
    480
    Looked around and didn't find that thread, also nothing from that thread came up in any of my searches ... :)
    I have duplicated this thread there thanks for pointing it out