Properly using a Managed C# .Net DLL

I am trying to use a Managed C# .Net DLL for parts of my code that I wish to keep secret(by later obfuscating the DLL); Well, it turns out that I cannot use MonoBehaviour inherited classes from within my DLL inside of the Unity3d Editor. Initially I got the error, that my class couldn't be found(which is located in my DLL). Finally I got past that, by making a C# file in my project that inherited from my class in the DLL, but I quickly got another error that wouldn't let me access variables from my inherited class(which is inside the DLL);

This is becoming very annoying, and I hope someone knows a way around these issues. Thank you.

Classes in your dll are just like any other classes, except that we don't support you assigning monobehaviours from your dll to a gameobject. It's fine to have a small script outside of your dll that does enherit from a class in your dll that has "the meat". If you cannot access members of that class, that sounds like an issue with the accesibility of those members. You might have them set to private, or internal. Make sure the type itself and the method/field in question are both public.

In my Managed C# DLL:

using UnityEngine;  
namespace My.Namespace  
{  
    public class MyCustomBehaviour : MonoBehaviour  
    {  
        public int myVariable = 0;  
    }  
}

Inside Unity Project:

using UnityEngine;  
using My.Namespace;

public class CustomBehaviour : MyCustomBehaviour  
{  
    public int Variable 
    {  
        get { return base.myVariable; }  
        set { base.myVariable = value; }  
    }  
}  

The above does not work. Any ideas?

I have the same issue. Unity requires your custom behaviour to derive directly from MonoBehaviour. The work around is to use your custom behaviour class as an adaptor. You then put your application logic in other classes that are referenced by your behaviour class.

Your issue is that you are using a Namespace with MonoBehaviour which is currently not supported in Unity. I had a similar issue. (see below quote from Unity scripting docs)

http://unity3d.com/support/documentation/ScriptReference/index.Writing_Scripts_in_Csharp.html

5.Don't use namespaces. Unity doesn't support placing your scripts inside of a namespace at the moment. This requirement will be removed in a future version.