Search Unity

Custom assembly build location

Discussion in 'Experimental Scripting Previews' started by Ramobo, Nov 24, 2019.

  1. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    72
    (I'm getting tired of this...)

    Bottom line: I need to be able to tell Unity where to build an assembly to (StreamingAssets), forget about it: let me manage the loading, and probably resolve scripts by full qualification and assembly signature, or something. From a user perspective, a "build destination" field and a "loaded automatically" checkbox on assembly definitions should work.

    Reasoning: I'm making a modding system and want to dogfeed on it as much as possible, meaning building my game as mods that go in StreamingAssets instead of {persistentDataPath}. I can fight the editor and engine (not that it's uncommon) and just move those assemblies from Managed into StreamingAssets using build post processing, but then any attached scripts won't resolve (the scenes are in addressables bundles that I also want to move to proper folders). I suppose changing the way scripts are resolved could work. This begs the question: How does Unity resolve attached scripts at runtime?
    In fact, I get the following error in Player.log for each of those assemblies that I move out of Managed:
    Code (CSharp):
    1. Fallback handler could not load library {BuildPath}/{ProductName}_Data/Mono/data-{X}.dll
    It works fine in the editor. As I said, the scripts don't resolve. I load the assemblies before scenes that contain references to those scripts get loaded. I tried Assembly.Load() and AppDomain.CurrentDomain.Load().
     
    Last edited: Dec 6, 2019
  2. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    72
    I'd really like to know about this.
     
  3. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    72
  4. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    72