Skip to content

Instantly share code, notes, and snippets.

@lyokato
Last active May 22, 2018 17:40
Show Gist options
  • Save lyokato/4bed94fb2437f9f12f43a23e7dcc0ded to your computer and use it in GitHub Desktop.
Save lyokato/4bed94fb2437f9f12f43a23e7dcc0ded to your computer and use it in GitHub Desktop.
public static ControllerState4 GetControllerState4(uint controllerMask)
{
#if UNITY_EDITOR
if (controllerMask == (uint)OVRInput.Controller.RTrackedRemote) {
ControllerState4 state = new ControllerState4();
state.ConnectedControllers = (uint)Controller.RTrackedRemote;
state.RIndexTrigger = OVROSX.JoyconTracker.Instance.GetTriggerState() ? 1.0f : 0.0f;
return state;
} else {
ControllerState4 controllerState = new ControllerState4();
return controllerState;
}
#else
if (version >= OVRP_1_16_0.version)
{
ControllerState4 controllerState = new ControllerState4();
OVRP_1_16_0.ovrp_GetControllerState4(controllerMask, ref controllerState);
return controllerState;
}
return new ControllerState4(GetControllerState2(controllerMask));
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment