System.ArgumentException: Base class UnityEngine.MonoBehaviour is value type and can't be inherited from
LelouBil opened this issue · 3 comments
LelouBil commented
I'm trying class injection but I keep having this error.
System.ArgumentException: Base class UnityEngine.MonoBehaviour is value type and can't be inherited from
at UnhollowerRuntimeLib.ClassInjector.RegisterTypeInIl2Cpp[T] () [0x000c3] in <e23489bf60bd4989ae101f3462221c4c>:0
at MyMods0c6c997e473c4c9fa6c7c23c8ef04755.Init.Setup () [0x00071] in <fca399b1c8814998958ecbbee0151af9>:0
What am I doing wrong ?
Class being injected
public class ModMain : UnityEngine.MonoBehaviour
{
private void OnEnable()
{
System.Console.WriteLine("enabled yes");
}
public ModMain(IntPtr pointer) : base(pointer)
{
}
}
Injector code
UnityVersionHandler.Initialize(2019, 4, 9);
ClassInjector.RegisterTypeInIl2Cpp<ModMain>();
knah commented
LelouBil commented
okay thanks