示例#1
0
    void Start()
    {
        BWEventManager.StartListening("ResetVR", ResetVR);

        // Reset the VR
        BWEventManager.TriggerEvent("ResetVR");
    }
示例#2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            BWEventManager.TriggerEvent("Stop");
            videoPlayer.Pause();
            canvas.gameObject.SetActive(true);            // Show the menu
        }

        // Reset all the VR - so recalibrate pose
        if (Input.GetKeyUp(KeyCode.R))
        {
            BWEventManager.TriggerEvent("ResetVR");
        }

        if (Input.GetKey(KeyCode.LeftShift))
        {
            var x = Input.GetAxis("Mouse X");
            var y = Input.GetAxis("Mouse Y");
            if (x != MouseX || y != MouseY)
            {
                rotationX += x * sensX * Time.deltaTime;
                rotationY += y * sensY * Time.deltaTime;
                rotationY  = Mathf.Clamp(rotationY, minY, maxY);
                MouseX     = x;
                MouseY     = y;
                transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);
            }
        }
    }
示例#3
0
 void ButtonClicked()
 {
     videoPlayer.Play();
     Debug.Log("Beach");
     gameObject.SetActive(false);                // Hide the menu
     BWEventManager.TriggerEvent("Start");
 }