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. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Loading scripts in runtime using Addressables

Discussion in 'Addressables' started by joon_off2, Sep 26, 2019.

  1. joon_off2

    joon_off2

    Joined:
    Oct 1, 2016
    Posts:
    2
    I am currently trying to incorporate a way to load scenes with script in them in runtime. So for example, a verified user/creator will create their own scene with assets and scripts (using Unity and our SDK/API) and upload it to our server, and users can play the content.

    I was able to verify that this is possible using AssetBundles and Assembly/DLLs to load them in runtime. I was wondering if there is any easier way to achieve this using Addressables. It seems not possible to make scripts addressables but I was wondering if there are any work-arounds or hacks to achieve this.

    Thank you!!
    JS
     
  2. AkshayGhosh

    AkshayGhosh

    Joined:
    Jan 8, 2017
    Posts:
    4
    hi @joon_off2 where you able to load scripts from Addressables.
     
  3. SleepyAgapornis

    SleepyAgapornis

    Joined:
    Sep 7, 2018
    Posts:
    23
    same question here
     
  4. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    anyone help?

    Want to know how to handle custom scripts,
     
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,938
    You cannot load working scripts through Asset Bundles or Addressables. You need to find another solution to write a custom environment if you want to compile and/or load scripts in runtime. Depending on what you want to do exactly.
    Maybe a simple DLL loader is adequate, maybe you need an entire Roslyn to compile new scripts, it's hard to tell in advance not knowing your design and it is a very broad topic.
     
  6. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    Thank you, yeah I tried and found do it with addressable seems impossible.
    I do not have a exactly need and just curious about how to make it. I'll learn in the future.
    hace a good day, Ninja