Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question How are games supposed to make themselves compatible with mods/extensions using DLLs?

Discussion in 'General Discussion' started by PabloCamacho1996, May 12, 2024.

  1. PabloCamacho1996

    PabloCamacho1996

    Joined:
    Jun 19, 2021
    Posts:
    8
    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?
     
    DragonCoder likes this.
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,308
    I'd just give them the ability to use Lua or something similar.
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,694