I’d like to know what the most correct approach is in terms of performance and security: Should an external developer create a DLL and then be allowed to create a ‘MonoBehavior’ (using some API I expose) and then add that ‘MonoBehavior’ to some GameObject as required by that developer? I think that option is the simplest but it gives too much control to the developer. Or should I develop my own “lifecycle” classes with my own OnStart(), OnUpdate(), etc., to isolate external content from the game, but I’m hesitant because in terms of performance, I think the “MonoBehavior” is much more efficient. How do games that expose an API and have systems to read external content and execute it do it? Do they run like any MonoBehavior component?
1 Like
I’d just give them the ability to use Lua or something similar.
There are a couple of options available for C#. Harmony is intended for users who want to mod apps while the second one is intended for the developer of the app.
https://github.com/pardeike/Harmony
https://assetstore.unity.com/packages/tools/integration/roslyn-c-runtime-compiler-142753