Using Visual Studio and Unity 3.0.0f5, I'm trying to define a EditorWindow Class In an external .net assembly.
using System;
using UnityEditor;
using UnityEngine;
public class MyCustomWindow : EditorWindow
{
private static MyCustomWindow _windowInstance = null;
[MenuItem("Window/Test")]
public static void Init()
{
MyCustomWindow e = MyCustomWindow.CreateInstance<MyCustomWindow>();
if (_windowInstance != e)
{
e.SomeOperation();
}
_windowInstance = e;
}
public void SomeOperation()
{
Debug.Log("Ran some operation");
}
}
//output error on menu selection
//Instance of MyCustomWindow couldn't be created because there is no script with that name.
//UnityEngine.ScriptableObject:CreateInstance()
//MyCustomWindow:Init()
The menu selection Item appears, but when used it gives the above output. I have an idea that I will have to, if possible, manually register MyCustomWindow to some list of window classes.
Has anyone successfully put an EditorWindow class in a .net assembly dll?