Troubles when using a class inside a .net dll.

Hello,

I’m trying to use my own mono/.net library in Unity, everything compiles fine but I the class always fails to instantiate at runtime. The class is derived from MonoBehaviour, and I’ve referenced the UnityEngine.dll when creating the library… Is there something I’m missing? I’ve attached a contrived example project which demonstrates the process I’m using.

Thanks,

Ritch…

107638–4120–$testing_208.zip (602 KB)

Currently classes extending MonoBehaviour and EditorWindow cannot be instantiated from external assemblies. I’m assuming the limitation extends to all unity classes, but I have only experimented with those two.

My workaround so far is to define an interface in my assembly and connect my assembly classes to classes in script files in assets, implementing that interface. Like this:

otee are aware of this problem, but I’m not sure how high priority it has.