Did you solve loading of scene with C# scripts and recompile/binding them dynamically?
No. I'm still far from that. After I got custom scenes, I stuck at implementing custom goto targets, then custom poses menu, then it were multiframe poses, walking between points.. and I still cannot open doors, or toggle lights. So now I'm just trying to finish those posing mess, before touching interactions with world.
Yet, I thought that it would be nice to provide some general purpose behaviours, like EnableGameObjectToggle, AnimatorToggle or StickToDickConverter. And allow modmaker to reference those library from unity (assuming "MonkeyBehavours.dll" is part of distibution).
As for custom scripts, for some reason, I'm still not sure about automatic loading user code.
But I'm fine, if user will load it on it's own this way:
- Modmaker creates unity
You must be registered to see the links
, so required code compiles as separate dll.
- That dll should implement bepinex plugin contract
- Custom asset is bundled as [asset-package] and [bepinex-plugin-script-package]
- Bepinex will load plugin into domain (and other malicious dependencies)
- Unity successfully deserializes stuff because required assembly is available
- It somewhat clear, that "if you put dll into bepinex/plugins - you agree with consequences"
I think it should work, but I haven't tested that.
And it works nicely. 6 bepinex libs as dependencies, 1 assemby definition, and as result - nice small script library that can be loaded by bepinex, and allow modmakers to create nice pool with fountain and procedural duck.