Search Unity

Scriptable objects of a given type automatically added to addressables group

Discussion in 'Addressables' started by JakHussain, Feb 12, 2020.

  1. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    165
    I have an open source modularity API called scriptable framework which is based on scriptable object architecture:

    https://github.com/pablothedolphin/Scriptable-Framework

    It works fine but the biggest issue with it is that it relies on the resources folder to load all objects on runtime initialisation and reset their data to avoid on of the major pitfalls of SO architecture which is that users need to write their own monobehaviours to initialise the data of their objects themselves and assign things manually:

    https://github.com/pablothedolphin/...rk/API/RuntimeObjects/RuntimeObjectManager.cs

    What I want is to replace this dependency on resources with the addressable asset system. However the AAS is based around asset groups and manually assigning assets to a group. What I want is:

    1. When a scriptable object of a given base type is created, automatically assign it to the addressable asset group for objects of that type
    2. If this group does not exist, create the group and assign the object
    3. The group is not intended to be an externally built addressable asset bundle but instead just serves the purpose of keeping track of all assets of that given base type
    4. If an SO of that type is deleted, it is removed from the group
    5. If an SO is created via duplication of another asset, it is also added to the group
    Again, this is only to serve the purpose of allowing me to automatically loop through all my RuntimeObjects when you enter play mode.

    My current system allows users to just get on with their normal workflow so long as they use a resources folder to store all their RuntimeObjects without any further manual set up or maintenance.

    Can I achieve this with addressable assets and if so, can anyone give me some guidance on how this automatic assignment, unassignment of assets would work?
     
    JoNax97 likes this.
  2. badgerdox

    badgerdox

    Joined:
    Jul 14, 2019
    Posts:
    18
    I think you could tweak your current system to work with addressables and it would be a tool that a lot of people would find useful. Ideally I'm thinking instead of using the resource folder you would use the labelling system to accomplish the same thing.

    I've made some tutorials about the Addressable process from start to finish that you might find useful. If you run into any problems I'm always here to help as well.
     
unityunity