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 <PartyEditorWindow>()) { instance = EditorWindow.GetWindow <PartyEditorWindow>("", false); instance.UpdateSlection(); } }
public static void MenuCreateWindow() { if (instance == null) { instance = CreateWindow <PartyEditorWindow>(); } else { EditorWindow.FocusWindowIfItsOpen <PartyEditorWindow>(); } instance.UpdateSlection(); }