示例#1
0
        // Update is called once per frame
        void Update()
        {
            MyVRMovement.MovingVRJoystick(Controller.GetAxis().y, Controller.GetAxis().x);

            if (Controller.GetPressDown(SteamVR_Controller.ButtonMask.Touchpad))
            {
                MyVRMovement.ActivateLevelLayout();
            }

            if (Controller.GetPressUp(SteamVR_Controller.ButtonMask.ApplicationMenu))
            {
                MyVRMovement.OnClickESC();
            }

            if (Controller.GetPressUp(SteamVR_Controller.ButtonMask.Grip))
            {
                raycastInfo.ShowRadarVive();
            }

            if (Controller.GetHairTriggerUp())
            {
                raycastInfo.RaycastHandOver();
            }

            if (Controller.GetHairTrigger())
            {
                RaycastHit hit;
                if (Physics.Raycast(trackedObj.transform.position, transform.forward, out hit, distance))
                {
                    hitPoint = hit.point;
                    ShowLaser(hit);
                }
                else
                {
                    ShowLaser();
                }
            }
            else
            {
                Laser.SetActive(false);
            }
        }