Skip to content
Elias Wennerberg edited this page Oct 4, 2026 · 1 revision

Mods & DLC

Commands are baked into the build cache, so assemblies loaded after startup (mods, DLC, Addressables) need explicit registration.

Self-registering mod

using System.Reflection;
using NoSlimes.Util.UniTerminal;

public class MyMod : MonoBehaviour
{
    private void Awake()
    {
        UniTerminal.DiscoverCommandsInAssembly(Assembly.GetExecutingAssembly());
    }

    [ConsoleCommand("mod_hello", Description = "Says hello from the mod.")]
    public static void HelloCommand()
    {
        Debug.Log("Hello from MyMod!");
    }
}

External mod loader

public void LoadMod(string path)
{
    Assembly modAssembly = Assembly.LoadFrom(path);
    UniTerminal.DiscoverCommandsInAssembly(modAssembly);
}

Only for dynamically loaded code — the main game assembly is already cached, don't re-scan it.

Clone this wiki locally