protected void ProcessMouseEvent(int id)
 {                                                                                                      /*	called from Process, but the argument is always 0
                                                                                                         *     process for all the three buttons
                                                                                                         *
                                                                                                         *     call OnScroll
                                                                                                         */
     PointerInputModule.MouseState           mousePointerEventData = this.GetMousePointerEventData(id); /*id is irrelevant*/
     PointerInputModule.MouseButtonEventData eventData             = mousePointerEventData.GetButtonState(PointerEventData.InputButton.Left).eventData;
     if (this.ForceAutoSelect())                                                                        /*set to false as default*/
     {
         base.eventSystem.SetSelectedGameObject(eventData.buttonData.pointerCurrentRaycast.gameObject, eventData.buttonData);
     }
     this.ProcessMousePress(eventData);
     this.ProcessMove(eventData.buttonData);
     this.ProcessDrag(eventData.buttonData);
     this.ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData);
     this.ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData.buttonData);
     this.ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData);
     this.ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData.buttonData);
     if (!Mathf.Approximately(eventData.buttonData.scrollDelta.sqrMagnitude, 0f))
     {
         GameObject eventHandler = ExecuteEvents.GetEventHandler <IScrollHandler>(eventData.buttonData.pointerCurrentRaycast.gameObject);
         ExecuteEvents.ExecuteHierarchy <IScrollHandler>(eventHandler, eventData.buttonData, ExecuteEvents.scrollHandler);
     }
 }
 private void FakeTouches()
 {
     PointerInputModule.MouseState           mousePointerEventData = this.GetMousePointerEventData(0);
     PointerInputModule.MouseButtonEventData eventData             = mousePointerEventData.GetButtonState(PointerEventData.InputButton.Left).eventData;
     if (eventData.PressedThisFrame())
     {
         eventData.buttonData.delta = Vector2.zero;
     }
     this.ProcessTouchPress(eventData.buttonData, eventData.PressedThisFrame(), eventData.ReleasedThisFrame());
     if (base.input.GetMouseButton(0))
     {
         this.ProcessMove(eventData.buttonData);
         this.ProcessDrag(eventData.buttonData);
     }
 }
示例#3
0
 protected void ProcessMouseEvent(int id)
 {
     PointerInputModule.MouseState           mousePointerEventData = this.GetMousePointerEventData(id);
     PointerInputModule.MouseButtonEventData eventData             = mousePointerEventData.GetButtonState(PointerEventData.InputButton.Left).eventData;
     this.ProcessMousePress(eventData);
     this.ProcessMove(eventData.buttonData);
     this.ProcessDrag(eventData.buttonData);
     this.ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData);
     this.ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData.buttonData);
     this.ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData);
     this.ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData.buttonData);
     if (!Mathf.Approximately(eventData.buttonData.scrollDelta.sqrMagnitude, 0f))
     {
         ExecuteEvents.ExecuteHierarchy <IScrollHandler>(ExecuteEvents.GetEventHandler <IScrollHandler>(eventData.buttonData.pointerCurrentRaycast.gameObject), eventData.buttonData, ExecuteEvents.scrollHandler);
     }
 }
示例#4
0
        private void ProcessMouseEvent(PointerInputModule.MouseState mouseData)
        {
            bool pressed  = mouseData.AnyPressesThisFrame();
            bool released = mouseData.AnyReleasesThisFrame();

            PointerInputModule.MouseButtonEventData eventData = mouseData.GetButtonState(PointerEventData.InputButton.Left).eventData;
            if (!OVRInputModule.UseMouse(pressed, released, eventData.buttonData))
            {
                return;
            }
            this.ProcessMousePress(eventData);
            this.ProcessMove(eventData.buttonData);
            this.ProcessDrag(eventData.buttonData);
            this.ProcessMousePress(mouseData.GetButtonState(PointerEventData.InputButton.Right).eventData);
            this.ProcessDrag(mouseData.GetButtonState(PointerEventData.InputButton.Right).eventData.buttonData);
            this.ProcessMousePress(mouseData.GetButtonState(PointerEventData.InputButton.Middle).eventData);
            this.ProcessDrag(mouseData.GetButtonState(PointerEventData.InputButton.Middle).eventData.buttonData);
            if (!Mathf.Approximately(eventData.buttonData.scrollDelta.sqrMagnitude, 0f))
            {
                GameObject eventHandler = ExecuteEvents.GetEventHandler <IScrollHandler>(eventData.buttonData.pointerCurrentRaycast.gameObject);
                ExecuteEvents.ExecuteHierarchy <IScrollHandler>(eventHandler, eventData.buttonData, ExecuteEvents.scrollHandler);
            }
        }