void GetClientMouseState(MouseState mouseData) { if (_client != null && ClusterHelper.Instance.UseInputEventPhase) { //Debug.Log("UpdateInputEvent"); ClusterHelper.Instance.UpdateInputEvent(); } if (_client != null && _mouseState != null) { CopyFromTo(_mouseState.buttonStateList[0], mouseData.GetButtonState(PointerEventData.InputButton.Left), isSendingPositionState, isSendingPressState); CopyFromTo(_mouseState.buttonStateList[1], mouseData.GetButtonState(PointerEventData.InputButton.Right), isSendingPositionState, isSendingPressState); CopyFromTo(_mouseState.buttonStateList[2], mouseData.GetButtonState(PointerEventData.InputButton.Middle), isSendingPositionState, isSendingPressState); #if FIX_DUP_RAYCAST ObjectSyncProfiler.BeginSample("RaycastAll"); RaycastAll(mouseData); ObjectSyncProfiler.EndSample("RaycastAll", true); #else 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; #endif } }
void OnApplicationQuit() { #if !CLUSTER_ENABLE return; #endif var info = "StandardInputModule: "; info += "_pressCount: " + _pressCount; info += "_frameCount: " + _frameCount; ObjectSyncProfiler.Log(info, ObjectSyncProfiler.HighLogLevel); }
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); }