private void OnGUI() { if (Event.current.type == EventType.KeyDown) { if (m_ActionMapsTree.HasFocus() && Event.current.keyCode == KeyCode.RightArrow) { if (!m_ActionsTree.HasSelection()) { m_ActionsTree.SelectFirstRow(); } m_ActionsTree.SetFocus(); } } EditorGUILayout.BeginVertical(); // Toolbar. EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); m_InputActionWindowToolbar.OnGUI(); GUILayout.Space(5); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); //Draw columns EditorGUILayout.BeginHorizontal(); var columnOneRect = GUILayoutUtility.GetRect(0, 0, 0, 0, Styles.actionTreeBackground, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); var columnTwoRect = GUILayoutUtility.GetRect(0, 0, 0, 0, Styles.actionTreeBackground, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); DrawActionMapsColumn(columnOneRect); DrawActionsColumn(columnTwoRect); DrawPropertiesColumn(); EditorGUILayout.EndHorizontal(); // Bottom margin GUILayout.Space(3); EditorGUILayout.EndVertical(); if (Event.current.type == EventType.ValidateCommand) { if (CopyPasteUtility.IsValidCommand(Event.current.commandName)) { Event.current.Use(); } } if (Event.current.type == EventType.ExecuteCommand) { m_CopyPasteUtility.HandleCommandEvent(Event.current.commandName); } }
private void OnGUI() { if (Event.current.type == EventType.KeyDown) { if (m_ActionMapsTree.HasFocus() && Event.current.keyCode == KeyCode.RightArrow) { if (!m_ActionsTree.HasSelection()) { m_ActionsTree.SelectFirstRow(); } m_ActionsTree.SetFocus(); } } EditorGUILayout.BeginVertical(); // Toolbar. EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); m_InputActionWindowToolbar.OnGUI(); GUILayout.Space(5); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); var isPickingInteractively = m_BindingPropertyView != null && m_BindingPropertyView.isInteractivelyPicking; EditorGUI.BeginDisabledGroup(isPickingInteractively); // Draw columns. var columnsRect = EditorGUILayout.BeginHorizontal(); var columnOneRect = GUILayoutUtility.GetRect(0, 0, 0, 0, Styles.actionTreeBackground, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); var columnTwoRect = GUILayoutUtility.GetRect(0, 0, 0, 0, Styles.actionTreeBackground, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); DrawActionMapsColumn(columnOneRect); DrawActionsColumn(columnTwoRect); DrawPropertiesColumn(); EditorGUILayout.EndHorizontal(); // If we're currently interactively picking a binding, aside from disabling and dimming the normal UI, display a large text over // the window that says we're waiting for input. // NOTE: We're not using EditorWindow.ShowNotification() as, aside from having trouble displaying our dynamically generated text // properly without clipping, notifications will automatically disappear after a brief moment. We want the input requester // to stay visible for as long as we're still looking for input. EditorGUI.EndDisabledGroup(); if (isPickingInteractively) { DrawInteractivePickingOverlay(columnsRect); } // Bottom margin. GUILayout.Space(3); EditorGUILayout.EndVertical(); if (Event.current.type == EventType.ValidateCommand) { if (CopyPasteUtility.IsValidCommand(Event.current.commandName)) { Event.current.Use(); } } if (Event.current.type == EventType.ExecuteCommand) { m_CopyPasteUtility.HandleCommandEvent(Event.current.commandName); } }