Пример #1
0
    // when video finished
    void VideoEndReached(UnityEngine.Video.VideoPlayer vp)
    {
        vp.Pause();


        // back to menu screen
        VRControl.BackToMenu();
    }
Пример #2
0
    void LookingDown()
    {
        if (!isPaused)
        {
            float angle = Vector3.Angle(Vector3.down, Camera.main.transform.forward);
            if (!lookingDown)
            {
                if (angle <= lookingDownMaxAngle)
                {
                    lookingDown      = true;
                    lookingDownTimer = 0f;
                }
            }
            else
            {
                if (angle > lookingDownMaxAngle)
                {
                    lookingDown = false;
                    return;
                }

                lookingDownTimer += Time.deltaTime;

                if (lookingDownTimer >= timeLookingDown)
                {
                    for (int i = 0; i < pausableScenes.Length; i++)
                    {
                        if (SceneManager.GetActiveScene().name == pausableScenes [i])
                        {
                            OpenPausePanel();
                            return;
                        }
                    }

                    for (int i = 0; i < returnableScenes.Length; i++)
                    {
                        if (SceneManager.GetActiveScene().name == returnableScenes [i])
                        {
                            VRControl.BackToMenu();
                            return;
                        }
                    }

                    lookingDownTimer = 0f;
                }
            }
        }
    }