我无法在Unity上的OVRInputModule中映射4个按钮(按钮B,按钮Y,PrimaryHandTrigger和SecondaryHandTrigger)。但是,这些按钮在映射时只能在Oculus Rift控制器上使用,而不能在Oculus Quest触摸控制器上使用。为什么会这样?即使我将其用作Button或RawButton,也仍然无效。通过脚本映射时,触摸控制器上的所有其他按钮都可以正常工作,但是仅这4个按钮存在此问题。
OVRInputModule:
public OVRInput.Button joyPadClickButton7 = OVRInput.Button.Two;
public OVRInput.RawButton joyPadClickButton8 = OVRInput.RawButton.RHandTrigger;
...
...
virtual protected PointerEventData.FramePressState GetGazeButtonState()
{
var pressed = Input.GetKeyDown(gazeClickKey) || OVRInput.GetDown(joyPadClickButton7) || OVRInput.GetDown(joyPadClickButton8);
var released = Input.GetKeyUp(gazeClickKey) || OVRInput.GetUp(joyPadClickButton7) || OVRInput.GetDown(joyPadClickButton8);
#if UNITY_ANDROID && !UNITY_EDITOR
// On Gear VR the mouse button events correspond to touch pad events. We only use these as gaze pointer clicks
// on Gear VR because on PC the mouse clicks are used for actual mouse pointer interactions.
pressed |= Input.GetMouseButtonDown(0);
released |= Input.GetMouseButtonUp(0);
#endif
if (pressed && released)
return PointerEventData.FramePressState.PressedAndReleased;
if (pressed)
return PointerEventData.FramePressState.Pressed;
if (released)
return PointerEventData.FramePressState.Released;
return PointerEventData.FramePressState.NotChanged;
}