Hi, in Unity, I have been attempting to create a modding API just for fun. I have attempted to do this by allowing modders to make .dll files with an API, and letting them place them within a mods folder created by my game.
I have created the API by using a C# script to create a Gamemodding namespace that contains a ModdingApi class that contains a variety of functions, and an interface that allows me to create OnStart functions for the modders.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace gameModding
{
public class ModdingApiTools
{
public static void TestDebugMessage(string message)
{
Debug.Log(message);
}
}
public interface IMod
{
void OnLoad();
}
}
I place that C# script in a folder with an Assembly Definition file, which compiles my API into a .dll file.

From there, modders can reference the .dll file in a Visual Studio Project and create their own mods in the form of .dll files using the API.
Now, this works fine when the functions within the API use definitions built into the Unity Engine (GameObject, Transform, Debug, etc.). But the API script will not allow me to access my own scripts and scriptable objects I have created for the game, and instead, throw a CS0246 error at me. (For example, in the below function, Weapondata is a scriptable object, and SpawnItem is a Monobehaviour script)

My question is; How can I allow my API to reference the scripts I have created? and if I can’t accomplish that with my current modding setup, is there an alternate modding structure that can allow for something like that?
If you can leave a reply, I will be most grateful.