Im not even sure it is possible but Id like to display a custom editor for a class in my behaviour. My setup is like this:
[System.Serializable]
public class Test
{
public bool A;
public int B;
}
public class TestBehaviour : MonoBehaviour
{
[SerializeField]
protected Test[] array= new Test[8];
}
// window is used to inspect specific Test objects
public class TestWindow : EditorWindow
{
Test T;
public void Set( Test T )
{
this.T = T;
Repaint();
}
void OnGUI()
{
if( T != null )
{
var editor = Editor.CreateEditor(T); // obviously can't work because T is not a UnityGame.Object
editor.OnInspectorGUI();
}
}
}
If anyone has recommendation for me, please let me know. Most probably there is better way to setup.