コード例 #1
0
        private void HandleInputEvents()
        {
            Event     current = Event.get_current();
            EventType type    = current.get_type();

            this.mousePosition = current.get_mousePosition();
            this.mouseOverView = (this.mousePosition.x < this.viewRect.width && this.mousePosition.y < this.viewRect.height);
            if (this.mouseOverView && type == 6)
            {
                if (this.MouseWheelZoomsView)
                {
                    if (!EditorGUI.get_actionKey())
                    {
                        this.ZoomView(this.mousePosition, -current.get_delta().y *this.zoomSpeed);
                        current.set_delta(new Vector2(0f, 0f));
                    }
                }
                else
                {
                    if (EditorGUI.get_actionKey())
                    {
                        this.ZoomView(this.mousePosition, -current.get_delta().y *this.zoomSpeed);
                        current.set_delta(new Vector2(0f, 0f));
                    }
                }
            }
            if (this.mouseOverView && type == 3 && (current.get_button() == 2 || Keyboard.AltAction()))
            {
                this.CancelAutoPan();
                this.DraggingCanvas  = true;
                this.scrollPosition -= current.get_delta();
                this.parentWindow.Repaint();
                this.ViewChanged = true;
            }
            if (type == 1)
            {
                this.DraggingCanvas   = false;
                this.IsEdgeScrolling  = false;
                this.edgeScrollRampUp = 0f;
            }
            if (GUIUtility.get_keyboardControl() == 0 && type == 4)
            {
                KeyCode keyCode  = Event.get_current().get_keyCode();
                KeyCode keyCode2 = keyCode;
                switch (keyCode2)
                {
                case 43:
                    goto IL_1AF;

                case 44:
                    return;

                case 45:
                    break;

                default:
                    if (keyCode2 == 61)
                    {
                        goto IL_1AF;
                    }
                    switch (keyCode2)
                    {
                    case 269:
                        break;

                    case 270:
                        goto IL_1AF;

                    default:
                        return;
                    }
                    break;
                }
                this.ZoomView(this.mousePosition, -0.1f);
                return;

IL_1AF:
                this.ZoomView(this.mousePosition, 0.1f);
            }
        }