コード例 #1
0
    void Update()
    {
        if (VRInput.GetButton(VRInput.Button.RightIndexTrigger))
        {
            gun.Fire();
        }

        if (VRInput.GetButtonDown(VRInput.Button.RightGripTrigger))
        {
            gun.Reload();
        }
    }
コード例 #2
0
        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);
        }