Hi!
I’ve written a pretty complex EditorWindow script and had once to restart the Editor with my EditorWindow open. After restart I noticed that my EditorWindow showed up but it was completely blank, all GUI elements just disappeared. Now before I continue to write more code, first I wanted to get rid of this “bug”. I made a new simple EditorWindow from a tutorial with just one button and restarted Unity. And the window was blank aswell, the button was gone.
Here is the code:
using UnityEngine;
using UnityEditor;
using System.Collections;
[System.Serializable]
public class EWTest : EditorWindow
{
public static EWTest window;
[MenuItem("Window/Test")]
public static void Init()
{
window = (EWTest)EditorWindow.GetWindow(typeof(EWTest));
window.autoRepaintOnSceneChange = true;
}
public void OnGUI()
{
if(window)
{
GUI.Button(new Rect(10, 10, window.position.width, 30), "TEST");
}
}
}
I searched on the forum, on Unity Answers, in google but couldn’t find any information about this issue.
I would appreciate any help, or a link to script reference, anything…
Thanx in advance!