Exemple #1
0
 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);
     }
 }
Exemple #2
0
 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);
     }
 }
Exemple #3
0
 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!
     }
 }
Exemple #4
0
 //if left hand joystick is pressed then this send a true bool
 public bool MenuSkip()
 {
     LeftHandDevice.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out bool val);
     return(val);
 }