Search Unity

Can you create an addressable at runtime?

Discussion in 'Addressables' started by Manafai, Feb 9, 2021.

  1. Manafai

    Manafai

    Joined:
    Oct 5, 2017
    Posts:
    15
    An explanation why I'm asking this. My project at work is basically a collection of simplistic and generic minigames - an object moves up and down, expands and shrinks, a background scrolls to make the object appear to me, etc.

    Now, my boss has asked me to create a system that will allow us to create more of these minigames on the fly without using the editor, because neither he nor his right hand man know Unity and I'm the sole developer of our tiny startup.

    For this purpose, I want to create a separate app. Essentially it would allow us to browse the computer for files and use them to create an addressable asset at runtime, which would then be uploaded to our server and called upon when a minigame is started in the main app. I want to test this out with images first and then move on to other things, but I have no idea where to even start with creating an addressable via script.
     
  2. dogboydog

    dogboydog

    Joined:
    Nov 23, 2012
    Posts:
    53
    I don't really think the system is designed to do anything like that. It seems like you make assets addressable through the editor and build the content, then you can upload that to your server. The Addressables.BuildPlayerContent() method seems to depend on the editor being open. It's possible you could make a simplified custom inspector or editor GUI window though that they could use (like something where they just drag the images in and select the animation preset). Maybe you could make a simple test scene for the mini games and make them need to know as little as possible
     
  3. Manafai

    Manafai

    Joined:
    Oct 5, 2017
    Posts:
    15
    I actually already made a custom inspector for this process just for myself to make things a bit smoother, but the problem is that my boss eventually wants to release this tool to other clients and allow them to some degree make their own minigames (they'd essentially just be selecting a preset behavior and two images for the background and object to animate).

    Honestly, I feel like the only way I'll be able to pull this off is if I just use a whole bunch of strings to load assets from Resources, StreamingAssets or download them from our server.
     
  4. krakentanz

    krakentanz

    Joined:
    Aug 13, 2020
    Posts:
    34
    hi @Manafai

    We're facing a similar situation here, wanting to build something that heavily relies on user generated content.

    So, i'm curious, did you figure something out? How did you end up doing this?
     
  5. Anoril

    Anoril

    Joined:
    Sep 24, 2013
    Posts:
    4
    Hi there! +1
    I want to be able to load user generated content added to a local folder close/inside the app structure.
     
  6. miracletechteam1

    miracletechteam1

    Joined:
    Sep 18, 2019
    Posts:
    24
  7. JavierFernandez9

    JavierFernandez9

    Joined:
    Feb 16, 2023
    Posts:
    4
    Hey @Manafai
    I'm trying to solve a similiar problem, and I think, after researching about the topic, is not enough information or documentation about the posibility to create Addressables at runtime. I'm reopening every thread related to this topic trying to have answers, but it looks so unsupported.
    Can you share you experience about your commented development? Maybe this bring some light in my coming months :D
    Thanks!
     
  8. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,912
    Addressables is built on top of Asset Bundles, and I don't believe there is a way to make asset bundles at runtime.

    Getting user generated content in via addressables will probably require to users to generate asset bundles via the Unity editor. Otherwise you'll have to find some non-Unity method of getting data into the runtime environment.
     
  9. JavierFernandez9

    JavierFernandez9

    Joined:
    Feb 16, 2023
    Posts:
    4
    Thank you @spiney199
    After a deep research it looks very restricted in terms of runtime creation. I will test a possible integration with a Runtime Editor asset from asset store that maybe could fit in our neccesities. But yep, in general it looks full dependent of Unity Editor.
    If I found a way to do that I will share my researches :D
     
    CSEliot likes this.
  10. CSEliot

    CSEliot

    Joined:
    May 9, 2014
    Posts:
    33