public bool OnTriggerUp(String hand) { if (hand == "l") { return(LeftHandDevice == null ? false : !LeftHandDevice.TryGetFeatureValue(CommonUsages.triggerButton, out bool val) && prevLeftTrigger); } else { return(RightHandDevice == null ? false : !RightHandDevice.TryGetFeatureValue(CommonUsages.triggerButton, out bool val) && prevRightTrigger); } }
public Vector3 GetVelocity(String hand) { if (hand == "l") { Vector3 vel; LeftHandDevice.TryGetFeatureValue(CommonUsages.deviceVelocity, out vel); return(vel); } else { Vector3 vel; RightHandDevice.TryGetFeatureValue(CommonUsages.deviceVelocity, out vel); return(vel); } }
public bool IsTriggerDown(String hand) { if (hand == "l") { return(LeftHandDevice == null ? false : LeftHandDevice.TryGetFeatureValue(CommonUsages.triggerButton, out bool val) && val); } else { return(RightHandDevice == null ? false : RightHandDevice.TryGetFeatureValue(CommonUsages.triggerButton, out bool val) && val); // THE ABOVE CODE WORKS! } }
//if left hand joystick is pressed then this send a true bool public bool MenuSkip() { LeftHandDevice.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out bool val); return(val); }