How to create an Editor Window from another class?


So, I have this Editor Window with a button that works fine, but I’m trying to create a simple new Editor Window after I click the button.

In my ‘if’ statement(that checks when the button was pressed), I have this:

Test test = (Test)EditorWindow.GetWindow(typeof(Test), true, "Test");

And my ‘Test’ class extends EditorWindow and is empty.

Just to be clear, the ‘Test’ class is the one having problems. That code I provided above won’t create an ‘instance’ of it.

Could anybody please help me, or point me in the right direction?

If I didn’t provide enough code or information, please feel free to ask.

Thank you,


Well, I found the error. I had to add test.Show(); after getting it.

I find it strange because I have another EditorWindow that doesn’t have the “Show()”, and it works perfectly. Oh well.

Thanks for all the help,