public static void CodeReload() { //detects if the window is alread opened and grabs it. //Code recompiles causes the instance reference to be lost. if (EditorWindow.HasOpenInstances <EnemyEntityEditor>()) { instance = EditorWindow.GetWindow <EnemyEntityEditor>("", false); instance.UpdateSlection(); } }
public static void MenuCreateWindow() { if (instance == null) { instance = CreateWindow <EnemyEntityEditor>(); } else { EditorWindow.FocusWindowIfItsOpen <EnemyEntityEditor>(); } instance.UpdateSlection(); }