Beispiel #1
0
        public override void    OnGUI()
        {
            if (this.buttonLeft == null)
            {
                this.buttonLeft  = "ButtonLeft";
                this.buttonRight = "ButtonRight";
            }

            EditorGUI.BeginDisabledGroup(!NGNavSelectionWindow.CanSelectPrevious);
            {
                if (GUILayout.Button(this.leftContent, this.buttonLeft, GUILayoutOptionPool.Height(this.hub.height)) == true)
                {
                    NGNavSelectionWindow.SelectPreviousSelection();
                }
            }
            EditorGUI.EndDisabledGroup();

            EditorGUI.BeginDisabledGroup(!NGNavSelectionWindow.CanSelectNext);
            {
                if (GUILayout.Button(this.rightContent, this.buttonRight, GUILayoutOptionPool.Height(this.hub.height)) == true)
                {
                    NGNavSelectionWindow.SelectNextSelection();
                }
            }
            EditorGUI.EndDisabledGroup();
        }
        private static void     HandleMouseInputs()
        {
            if (EditorApplication.isCompiling == true)
            {
                if (NGNavSelectionWindow.savedOnCompile == false)
                {
                    NGNavSelectionWindow.savedOnCompile = true;
                    NGNavSelectionWindow.SaveHistoric();
                }

                return;
            }

            IntPtr activeWindow = NativeMethods.GetActiveWindow();

            if (activeWindow != IntPtr.Zero)
            {
                // Go to previous selection.
                if (NativeMethods.GetAsyncKeyState(5) != 0)
                {
                    if (NGNavSelectionWindow.buttonWasDown == false)
                    {
                        NGNavSelectionWindow.buttonWasDown = true;
                        NGNavSelectionWindow.SelectPreviousSelection();
                    }
                }
                // Go to next selection.
                else if (NativeMethods.GetAsyncKeyState(6) != 0)
                {
                    if (NGNavSelectionWindow.buttonWasDown == false)
                    {
                        NGNavSelectionWindow.buttonWasDown = true;
                        NGNavSelectionWindow.SelectNextSelection();
                    }
                }
                else
                {
                    NGNavSelectionWindow.buttonWasDown = false;
                }
            }
        }