コード例 #1
0
    void Update()
    {
        if (Controller.GetHairTriggerDown())
        {
            Debug.Log(gameObject.name + " Trigger Press");

            animate = !animate;
            animator.SetBool("Animate", animate);
        }

        if (Controller.GetPressDown(SteamVR_Controller.ButtonMask.Grip))
        {
            Debug.Log(gameObject.name + " Grip Press");
            lightsScript.TurnLights();
        }

        if (Controller.GetPress(SteamVR_Controller.ButtonMask.Touchpad))
        {
            Vector2 touchpad = (Controller.GetAxis(Valve.VR.EVRButtonId.k_EButton_Axis0));
            print("Pressing Touchpad");


            if (touchpad.x > 0.7f)
            {
                print("Moving Right");
                sculptureScript.NextModel();
            }

            else if (touchpad.x < -0.7f)
            {
                print("Moving left");
                sculptureScript.PreviousModel();
            }
        }
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.LeftControl))
        {
            animate = !animate;
            animator.SetBool("Animate", animate);
        }

        if (Input.GetKeyDown(KeyCode.Tab))
        {
            lightsScript.TurnLights();
        }
        var scroll = Input.GetAxis("Mouse ScrollWheel");

        if (scroll > 0)
        {
            sculptureScript.NextModel();
        }
        if (scroll < 0)
        {
            sculptureScript.PreviousModel();
        }
    }