public static bool GetDown(VRButton input) { //if cast results in different value then inputs are mutually exclusive VRAxis axisInput = (VRAxis)input; if (axisInput.ToString() == input.ToString()) //input is also an axis { if (GetAxisRaw(axisInput) > 0) { //input recieved if (axisAvailable[axisInput]) { //input is new (wasn't previously being held axisAvailable[axisInput] = false; return(true); } } } else //input is a button { return(Input.GetButtonDown(input.ToString())); } return(false); }
public static bool GetUp(VRButton input) { VRAxis axisInput = (VRAxis)input; if (axisInput.ToString() == input.ToString()) { //input is also an axis if (GetAxisRaw(axisInput) <= 0) { //input not recieved if (axisWasBeingHeld[axisInput]) { //input is new (wasn't previously being held axisWasBeingHeld[axisInput] = false; return(true); } } } else { return(Input.GetButtonUp(input.ToString())); } return(false); }
private void AxesStateLabel(VRButton button) { var axes = VRInput.GetAxes(button); UnityGUI.Label(button.ToString() + " X: " + axes[0].ToString("0.000")); UnityGUI.Label(button.ToString() + " Y: " + axes[1].ToString("0.000")); }
private void ButtonStateLabel(VRButton button) { var state = "Up"; if (VRInput.GetButton(button)) { state = "Down"; } else if (VRInput.GetTouch(button)) { state = "Touching"; } else if (VRInput.GetHovering(button) > Mathf.Epsilon) { state = "Hovering"; } UnityGUI.Label(button.ToString() + ": " + state); }
public static bool Get(VRButton input) { return(Input.GetAxisRaw(input.ToString()) > 0); }
public static float GetAxisRaw(VRButton input) { return(Input.GetAxisRaw(input.ToString())); }
private void AxisStateLabel(VRButton button) { UnityGUI.Label(button.ToString() + ": " + VRInput.GetAxis(button).ToString("0.000")); }