private void processModifyFromOuter(PointerInputModule.MouseState mouseData)
 {
     if (!_bufferFlushed)
     {
         mouseData.GetButtonState(PointerEventData.InputButton.Left).eventData.buttonData.position = _modifyPosBuffer;
         mouseData.GetButtonState(PointerEventData.InputButton.Left).eventData.buttonState         = (PointerEventData.FramePressState)_modifyButtonStateBuffer;
         _bufferFlushed = true;
     }
 }
    private void RaycastAll(PointerInputModule.MouseState mouseData)
    {
        var leftData = mouseData.GetButtonState(PointerEventData.InputButton.Left).eventData.buttonData;

        eventSystem.RaycastAll(leftData, m_RaycastResultCache);
        var raycast = FindFirstRaycast(m_RaycastResultCache);

        leftData.pointerCurrentRaycast = raycast;
        m_RaycastResultCache.Clear();

        var rightData  = mouseData.GetButtonState(PointerEventData.InputButton.Right).eventData.buttonData;
        var middleData = mouseData.GetButtonState(PointerEventData.InputButton.Middle).eventData.buttonData;

        rightData.pointerCurrentRaycast  = raycast;
        middleData.pointerCurrentRaycast = raycast;
    }
 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))
     {
         GameObject eventHandler = ExecuteEvents.GetEventHandler <IScrollHandler>(eventData.buttonData.pointerCurrentRaycast.gameObject);
         ExecuteEvents.ExecuteHierarchy <IScrollHandler>(eventHandler, eventData.buttonData, ExecuteEvents.scrollHandler);
     }
 }
 // Token: 0x0600627D RID: 25213 RVA: 0x00231DD4 File Offset: 0x002301D4
 protected void ProcessMouseEvent()
 {
     PointerInputModule.MouseState           mouseState = this.VRCGetMousePointerEventData();
     PointerInputModule.MouseButtonEventData eventData  = mouseState.GetButtonState(PointerEventData.InputButton.Left).eventData;
     this.overSelection = null;
     if (eventData.buttonData.pointerCurrentRaycast.gameObject != null)
     {
         this.overSelection = eventData.buttonData.pointerCurrentRaycast.gameObject.GetComponentInParent <Selectable>();
     }
     this.ProcessMousePress(eventData, true);
     this.ProcessMove(eventData.buttonData);
     this.ProcessDrag(eventData.buttonData);
     PointerInputModule.MouseButtonEventData eventData2 = mouseState.GetButtonState(PointerEventData.InputButton.Right).eventData;
     eventData2.buttonData.button = PointerEventData.InputButton.Left;
     this.ProcessMousePress(eventData2, false);
     this.ProcessMove(eventData2.buttonData);
     this.ProcessDrag(eventData2.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);
     }
 }
Example #5
0
        private void ProcessMouseEvent()
        {
            PointerInputModule.MouseState mousePointerEventData = this.GetMousePointerEventData(-1);
            bool pressed  = mousePointerEventData.AnyPressesThisFrame();
            bool released = mousePointerEventData.AnyReleasesThisFrame();

            PointerInputModule.MouseButtonEventData eventData = mousePointerEventData.GetButtonState(PointerEventData.InputButton.Left).eventData;
            if (!RewiredStandaloneInputModule.UseMouse(pressed, released, eventData.buttonData))
            {
                return;
            }
            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);
            }
        }
        protected void ProcessMouseEvent(int id)
        {
            PointerInputModule.MouseState           pointerEventData = this.GetMousePointerEventData(id);
            PointerInputModule.MouseButtonEventData eventData        = pointerEventData.GetButtonState((PointerEventData.InputButton) 0).get_eventData();
            RaycastResult pointerCurrentRaycast1 = ((PointerEventData)eventData.buttonData).get_pointerCurrentRaycast();

            this._currentFocusedGameObject = ((RaycastResult) ref pointerCurrentRaycast1).get_gameObject();
            this.ProcessMousePress(eventData);
            this.ProcessMove((PointerEventData)eventData.buttonData);
            this.ProcessDrag((PointerEventData)eventData.buttonData);
            this.ProcessMousePress(pointerEventData.GetButtonState((PointerEventData.InputButton) 1).get_eventData());
            this.ProcessDrag((PointerEventData)pointerEventData.GetButtonState((PointerEventData.InputButton) 1).get_eventData().buttonData);
            this.ProcessMousePress(pointerEventData.GetButtonState((PointerEventData.InputButton) 2).get_eventData());
            this.ProcessDrag((PointerEventData)pointerEventData.GetButtonState((PointerEventData.InputButton) 2).get_eventData().buttonData);
            Vector2 scrollDelta = ((PointerEventData)eventData.buttonData).get_scrollDelta();

            if (Mathf.Approximately(((Vector2) ref scrollDelta).get_sqrMagnitude(), 0.0f))
            {
                return;
            }
            RaycastResult pointerCurrentRaycast2 = ((PointerEventData)eventData.buttonData).get_pointerCurrentRaycast();

            ExecuteEvents.ExecuteHierarchy <IScrollHandler>(ExecuteEvents.GetEventHandler <IScrollHandler>(((RaycastResult) ref pointerCurrentRaycast2).get_gameObject()), (BaseEventData)eventData.buttonData, (ExecuteEvents.EventFunction <M0>)ExecuteEvents.get_scrollHandler());
        }
    private void ProcessMouseEventEx(int id_)
    {
        ObjectSyncProfiler.BeginSample("ProcessMouseEventEx");
#if FIX_DUP_RAYCAST
        PointerInputModule.MouseState mouseData = null;
        if (_client != null)
        {
            ObjectSyncProfiler.BeginSample("GetMousePointerEventData");
            mouseData = GetMousePointerEventData(id_);
            ObjectSyncProfiler.EndSample("GetMousePointerEventData", true);

            ObjectSyncProfiler.BeginSample("GetClientMouseState");
            GetClientMouseState(mouseData);
            ObjectSyncProfiler.EndSample("GetClientMouseState", true);
            mousePositionBuff = mouseData.GetButtonState(PointerEventData.InputButton.Left).eventData.buttonData.position;
        }

        if (_server != null)
        {
            ObjectSyncProfiler.BeginSample("GetMousePointerEventData");
            mouseData = GetMousePointerEventData(id_);
            ObjectSyncProfiler.EndSample("GetMousePointerEventData", true);

            //2017.3.3 hayate add start
            processModifyFromOuter(mouseData);
            //2017.3.3 hayate add end
            mousePositionBuff = mouseData.GetButtonState(PointerEventData.InputButton.Left).eventData.buttonData.position;

            ObjectSyncProfiler.BeginSample("SendServerMouseState");
            SendServerMouseState(mouseData);
            ObjectSyncProfiler.EndSample("SendServerMouseState", true);

            ObjectSyncProfiler.BeginSample("RaycastAll");
            RaycastAll(mouseData);
            ObjectSyncProfiler.EndSample("RaycastAll", true);
        }
#else
        var mouseData = GetMousePointerEventData(id_);

        Simulate(mouseData);

        ObjectSyncProfiler.BeginSample("GetClientMouseState");
        GetClientMouseState(mouseData);
        ObjectSyncProfiler.EndSample("GetClientMouseState", true);

        ObjectSyncProfiler.BeginSample("SendServerMouseState");
        SendServerMouseState(mouseData);
        ObjectSyncProfiler.EndSample("SendServerMouseState", true);
#endif

#if FIX_DUP_RAYCAST
        if (mouseData != null)
        {
#endif
        ObjectSyncProfiler.BeginSample("ProcessMouseEvent");
        var leftButtonData = mouseData.GetButtonState(PointerEventData.InputButton.Left).eventData;

        // Process the first mouse button fully
        ProcessMousePress(leftButtonData);
        ProcessMove(leftButtonData.buttonData);
        ProcessDrag(leftButtonData.buttonData);

        // Now process right / middle clicks
        ProcessMousePress(mouseData.GetButtonState(PointerEventData.InputButton.Right).eventData);
        ProcessDrag(mouseData.GetButtonState(PointerEventData.InputButton.Right).eventData.buttonData);
        ProcessMousePress(mouseData.GetButtonState(PointerEventData.InputButton.Middle).eventData);
        ProcessDrag(mouseData.GetButtonState(PointerEventData.InputButton.Middle).eventData.buttonData);

        if (!Mathf.Approximately(leftButtonData.buttonData.scrollDelta.sqrMagnitude, 0.0f))
        {
            var scrollHandler = ExecuteEvents.GetEventHandler <IScrollHandler>(leftButtonData.buttonData.pointerCurrentRaycast.gameObject);
            ExecuteEvents.ExecuteHierarchy(scrollHandler, leftButtonData.buttonData, ExecuteEvents.scrollHandler);
        }
        ObjectSyncProfiler.EndSample("ProcessMouseEvent", true);

#if FIX_DUP_RAYCAST
    }
#endif
        ObjectSyncProfiler.EndSample("ProcessMouseEventEx", true);
    }