示例#1
0
    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);
    }
示例#2
0
    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);
    }
示例#3
0
 public static float GetAxisRaw(VRAxis input)
 {
     return(Input.GetAxisRaw(input.ToString()));
 }