private static void ShowNewPanel() { if (CurrentPanel != null) { CurrentPanel.CloseOrSetInactive(); } if (Application.isPlaying && !EditorApplication.isPaused && MonKeyInternalSettings.Instance.PauseGameOnConsoleOpen) { pausedByMonkey = true; EditorApplication.isPaused = true; } var monkeyPanel = GetWindow <CommandConsoleWindow>(); monkeyPanel.wantsMouseMove = true; monkeyPanel.Show(); monkeyPanel.titleContent = new GUIContent(" MonKey", MonkeyStyle.Instance.MonkeyHead, "Uuuh! Uuuh!"); monkeyPanel.maxSize = new Vector2(WindowMaxWidth, WindowMaxHeight); monkeyPanel.minSize = new Vector2(WindowMinWidth, WindowMinHeight); CurrentPanel = monkeyPanel; SetFirstHistoryCommandSelected(); if (CurrentPanel != null) { CurrentPanel.isActiveMode = true; CurrentPanel.JustOpenedActiveMode = true; GetIsDockedInfo(); } }
public static void TogglePanelCustom() { if (MonkeyStyle.Instance.IsFakeTextureInUse) { MonkeyStyle.Instance.PostInstanceCreation(); } if (CommandManager.Instance.CommandCount == 0) { CommandManager.Instance.OnEnable(); } if (!CurrentPanel) { ShowNewPanel(); } else { if (CurrentPanel.isDockedInfo == null) { GetIsDockedInfo(); } if (CurrentPanel.IsDocked) { if (CurrentPanel.isActiveMode) { if (!CurrentPanel.Focused) { CurrentPanel.Focus(); CurrentPanel.Focused = true; } else { ResetSearchTerms(); CurrentPanel.CloseOrSetInactive(); } } else { ActivatePanel(); } } else { CurrentPanel.CloseOrSetInactive(); } } }
private static void ResetWindow() { EditorWindow window = focusedWindow; try { CurrentPanel = FindObjectOfType <CommandConsoleWindow>(); if (CurrentPanel) { ShowNewPanel(); CurrentPanel.CloseOrSetInactive(); } /* if (window) * window.Focus();*/ } catch (NullReferenceException) { //ignore, due to change of version } }