bool HandleClicks(GamePadState now, GamePadState before) { if (GamePadHelper.IsShoulderPressed(now)) { return(false); } // Left click if (GamePadHelper.IsPressDown(now.Buttons.A, before.Buttons.A)) { _Input.Mouse.LeftButtonDown(); } else if (GamePadHelper.IsPressUp(now.Buttons.A, before.Buttons.A)) { _Input.Mouse.LeftButtonUp(); } // Right click if (GamePadHelper.IsPressDown(now.Buttons.B, before.Buttons.B)) { _Input.Mouse.RightButtonDown(); } else if (GamePadHelper.IsPressUp(now.Buttons.B, before.Buttons.B)) { _Input.Mouse.RightButtonUp(); } return(false); }
bool HandleGUI(GamePadState now, GamePadState before) { if (GamePadHelper.IsPressUp(now.Buttons.Back, before.Buttons.Back)) { _GC.IsHideUI = !_GC.IsHideUI; } return(false); }
bool HandleInput(GamePadState nowState, GamePadState prevState) { if (GamePadHelper.IsPressUp(nowState.Buttons.Start, prevState.Buttons.Start)) { Recenter(); } if (nowState.Buttons.LeftShoulder == ButtonState.Pressed) { Vector2 rightStick = new Vector2(nowState.ThumbSticks.Right.X, nowState.ThumbSticks.Right.Y); Vector2 leftStick = new Vector2(nowState.ThumbSticks.Left.X, nowState.ThumbSticks.Left.Y); if (rightStick.magnitude > 0.1f) { VR.Settings.Rotation += rightStick.x * Time.deltaTime * 50f; VR.Settings.OffsetY += rightStick.y * Time.deltaTime * 0.1f; } if (leftStick.magnitude > 0.1f) { VR.Settings.Distance += leftStick.x * Time.deltaTime * 0.1f; VR.Settings.Angle += leftStick.y * Time.deltaTime * 50f; } if (nowState.DPad.Up == ButtonState.Pressed) { VR.Settings.IPDScale += Time.deltaTime * 0.1f; } else if (nowState.DPad.Down == ButtonState.Pressed) { VR.Settings.IPDScale -= Time.deltaTime * 0.1f; } // Impersonate if (GamePadHelper.IsPressUp(nowState.Buttons.Y, prevState.Buttons.Y)) { if (LockTarget == null || !LockTarget.IsValid) { Impersonate(VR.Interpreter.Actors.FirstOrDefault()); } else { Impersonate(null); } } } return(false); }
bool HandleSekkusu(GamePadState now, GamePadState before) { // Speed if (GamePadHelper.IsPressUp(now.DPad.Up, before.DPad.Up)) { _Scene.Pad.ChangeSpeed(Mathf.Clamp(_Scene.Pad.speed + 0.6f, _Scene.Pad.SpeedMin, _Scene.Pad.SpeedMax)); } else if (GamePadHelper.IsPressUp(now.DPad.Down, before.DPad.Down)) { _Scene.Pad.ChangeSpeed(Mathf.Clamp(_Scene.Pad.speed - 0.6f, _Scene.Pad.SpeedMin, _Scene.Pad.SpeedMax)); } // Pose if (GamePadHelper.IsPressUp(now.DPad.Left, before.DPad.Left)) { ChangePose(-1); } else if (GamePadHelper.IsPressUp(now.DPad.Right, before.DPad.Right)) { ChangePose(1); } // Mode if (GamePadHelper.IsPressUp(now.Buttons.X, before.Buttons.X)) { ToggleGrind(); } if (GamePadHelper.IsPressUp(now.Buttons.Y, before.Buttons.Y)) { TogglePiston(); } // E*********n if (GamePadHelper.IsPressDown(now.Buttons.RightStick, before.Buttons.RightStick)) { E*******e(false); } if (GamePadHelper.IsPressDown(now.Buttons.LeftStick, before.Buttons.LeftStick)) { E*******e(true); } return(false); }