Reference: https://docs.unity3d.com/Manual/OculusControllers.html
Name |
One |
Two |
Three |
Four |
Start |
PrimaryThumbstick |
SecondaryThumbstick |
if (XRInput.Get(XRInput.Button.One)) {
Debug.Log("Button One is being held");
}
if (XRInput.GetDown(XRInput.Button.One)) {
Debug.Log("Button One was pressed");
}
if (XRInput.GetUp(XRInput.Button.One)) {
Debug.Log("Button One was released");
}
Name |
PrimaryIndexTrigger |
SecondaryIndexTrigger |
PrimaryHandTrigger |
SecondaryHandTrigger |
if (XRInput.Get(XRInput.Axis1D.PrimaryIndexTrigger)) {
Debug.Log("Primary Index Trigger is being held");
}
Debug.Log($"Primary Index Trigger: {XRInput.GetAxis(XRInput.Axis1D.PrimaryIndexTrigger)}");
Name |
PrimaryThumbstickHorizontal |
PrimaryThumbstickVertical |
SecondaryThumbstickHorizontal |
SecondaryThumbstickVertical |
if (XRInput.Get(XRInput.Axis2D.PrimaryThumbstickHorizontal)) {
Debug.Log("Primary Thumbstick Horizontal is being held to either the left or right");
}
Debug.Log($"Primary Thumbstick Horizontal: {XRInput.GetAxis(XRInput.Axis2D.PrimaryThumbstickHorizontal)}");