Common C# Editor and Game classes

Is it possible to share the same (non-monobehaviour) class between Editor scripts and Game scripts. I tried putting the common class in a few different folders but each time the “other” script complained it could’t find the common class?

thanks,
Richard.

http://unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html

You cant directly reference scripts outside of the Standard Assets and Plugins folder. But you can of course use javascript dynamic typing.

eg. GetComponent(“YourScript”) instead of GetComponent(YourScript)

Or you simply move the Runtime script to the Plugins folder then you can fully acccess it.

I hate it when the answer is in the manual! - sorry about that. I think the problem is that I am not recompiling the game scripts after changing the UnityEditor namespace script - will give it a try.

thanks,
Richard.

It’s not about what you compile first. There is a predefined order in which scripts (Or groups of scripts to be accurate) are compiled and how their dependency is set up. You can all read that in the above document.