Type monoScript in javascript

Hi everyone,

I’m using the ‘MonoScript’ type in one of my javascripts and trying to build, I noticed the script has to be in the “Editor” folder for the type MonoScript to work.

However, when I put it there and build, the script is just left out.
I get no error, but the warning

“Script attached to ‘Main Camera’ in scene ‘Temp/__BuildPlayer Backupscene’ is missing or no valid script is attached.
UnityEditor.HostView:OnGUI()”

and quite unsurprisingly, the script (showing GUI stuff when ESC is pressed) won’t work in the build.
The script is perfectly attached to my GameObject in editor, where it works just fine.

The most similar thing I found on the web was a guy using C# and the problem was that his script didn’t derive from MonoBehaviour - but as far as I got it, this is done automatically in javascripts.

So my question is “How can I make the type ‘MonoScript’ work in javascript?”

PS
I’m using the UART, maybe this does not compile the editor folder on windows?
This thing has its own Editor folder and the readme says it has to be renamed to ‘Editor_’ before building for windows - but my builds for windows worked without that.
(Can a script tell unity to not build a certain folder when building for windows?)

Runtime classes cannot use any UnityEditor classes. MonoScript is a UnityEditor class. If you intend on writing an Editor script/class, it must be in the Assets/Editor folder.