Exemple #1
0
 public void switchScene(string inputScene)
 {
     if (!m_CameraFade.IsFading)
     {
         StartCoroutine(m_CameraFade.BeginFadeOut(true));
         SceneManager.LoadScene(inputScene, LoadSceneMode.Single);
     }
 }
Exemple #2
0
        private IEnumerator StartPhase()
        {
            // Make sure the Outro UI is not being shown and the intro UI is.
            StartCoroutine(m_UIController.ShowIntroUI());
            StartCoroutine(m_UIController.HideOutroUI());

            m_CameraContainer.transform.position = new Vector3(0, 0, 0);

            // To make sure the user is facing the right way show the arrows.
            m_GuiArrows.Show();

            // Turn off the fog whilst showing the intro.
            RenderSettings.fog = false;

            // Make sure the game is stopped for the flyer's health.
            m_HealthController.StopGame();

            // Since a selection slider is being used, hide the radial and show the reticle.
            m_SelectionSlider.gameObject.SetActive(true);
            m_SelectionRadial.Hide();
            m_Reticle.Show();
            m_FlyerMovementController.m_Speed = 70f;
            m_flyerPlayership.SetActive(false);



            // The user should hold Fire1 for the selection slider so turn on warnings for tapping.
            m_InputWarnings.TurnOnDoubleTapWarnings();
            m_InputWarnings.TurnOnSingleTapWarnings();

            // In order wait for the selection slider to fill, then the intro UI to hide, then the camera to fade out.
            yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_UIController.HideIntroUI()));

            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(m_IntroOutroFadeDuration, false)));

            // Once the screen has faded out, we can hide UI elements we don't want to see anymore like the arrows and reticle.
            m_GuiArrows.Hide();
            m_Reticle.Hide();

            // Turn the fog back on so spawned objects won't appear suddenly.
            RenderSettings.fog = true;

            // The user now needs to tap to fire so turn off the warnings.
            m_InputWarnings.TurnOffDoubleTapWarnings();
            m_InputWarnings.TurnOffSingleTapWarnings();

            // Now wait for the screen to fade back in.
            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(m_IntroOutroFadeDuration, false)));
        }
    private IEnumerator FadeToScene(string sceneName)
    {
        if (Camera.main != null)
        {
            VRCameraFade cameraFade = Camera.main.gameObject.GetComponent <VRCameraFade>();
            if (cameraFade != null)
            {
                yield return(StartCoroutine(cameraFade.BeginFadeOut(false)));
            }
        }
        //check to see if we were the scene that we preloaded
        if (!string.IsNullOrEmpty(_sceneName))
        {
            if (_sceneName == sceneName)
            {
                while (_curScene.progress <= 0.89f)
                {
                    yield return(null);
                }

                _curScene.allowSceneActivation = true;
            }
            else
            {
                LoadSceneNormal(sceneName);
            }
        }
        else
        {
            LoadSceneNormal(sceneName);
        }
    }
        private IEnumerator ActivateButton()
        {
            // If the camera is already fading, ignore.
            if (m_CameraFade.IsFading)
            {
                yield break;
            }

            // Wait for the camera to fade out.
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            Debug.Log(m_InteractiveItem.gameObject.name);
            Debug.Log(oldLocation);

            if (m_InteractiveItem.gameObject.name == "Exit")
            {
                PlayerState playerState = player.GetComponent <PlayerState>();
                player.transform.position = playerState.oldLocation;
                GameObject           navPanel             = GameObject.Find("NavPanel");
                GotoNavigationPortal gotoNavigationPortal = navPanel.GetComponent <GotoNavigationPortal>();
                gotoNavigationPortal.inNavigation = false;
            }
            else
            {
                player.transform.position = new Vector3(loc_X, loc_Y, loc_Z);
            }

            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(true)));
        }
Exemple #5
0
    IEnumerator DoTransition()
    {
        yield return(new WaitForSeconds(0.70f));

        Shoot();
        yield return(new WaitForSeconds(0.05f));

        Events.OnKick();
        RealShoot();
        yield return(new WaitForSeconds(1.5f));

        yield return(StartCoroutine(vrCameraFade.BeginFadeOut(0.5f, false)));

        SetFloors(false);
        Events.OnShowResult(resultsManager.GetResult(), true);
        yield return(new WaitForSeconds(3));

        if (!GetComponent <ResultsManager>().isReady())
        {
            Events.OnRestart();
        }
        else
        {
            Events.OnShowTotalResult();
        }
    }
Exemple #6
0
    IEnumerator Restart()
    {
        yield return(StartCoroutine(vrCameraFade.BeginFadeOut(0.5f, false)));

        RenderSettings.skybox = stadium;
        Game.Instance.gameManager.CheckToRestart();
    }
Exemple #7
0
    async public override void OnInteractionTrigger(InteractionModes mode)
    {
        teleportIsOver = false;

        StartCoroutine(cameraFade.BeginFadeOut(fadeTime, false));

        if (audioClip)
        {
            ReferenceManagerIndependent.Instance.PlayAudioClip(audioClip);
        }

        CharacterController playerChar = who.GetComponent <CharacterController>();

        if (playerChar)
        {
            referenceManagerIndependent.PlatformManager.GetPlayerController().enabled = false;
            playerChar.enabled = false;
        }

        await new WaitForSeconds(fadeTime);
        who.transform.position = teleportDestiny;


        StartCoroutine(cameraFade.BeginFadeIn(fadeTime, false));

        if (playerChar)
        {
            referenceManagerIndependent.PlatformManager.GetPlayerController().enabled = true;
            playerChar.enabled = true;
        }

        teleportIsOver = true;

        OnFinish();
    }
    private IEnumerator ActivateButton()
    {
        // If the camera is already fading, ignore.
        if (m_CameraFade.IsFading)
        {
            yield break;
        }

        // If anything is subscribed to the OnButtonSelected event, call it.
        if (OnButtonSelected != null)
        {
            OnButtonSelected(this);
        }

        // Wait for the camera to fade out.
        yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

        ViewController view = GameObject.Find("ViewController").GetComponent <ViewController>();

        view.startImg = gameObject.GetComponent <Thumbnail>().number;

        SceneManager.LoadScene("Gallery360_CubeMap");

        /*    if (view.isStereo)
         *      SceneManager.LoadScene("Gallery_CubeMap", LoadSceneMode.Single);
         *  else
         *      SceneManager.LoadScene("Gallery_CubeMap_LeftOnly", LoadSceneMode.Single);
         */
        m_CameraFade.FadeInBlack(true);
    }
Exemple #9
0
        private IEnumerator RotateCamera(float increment)
        {
            // Determine how the camera should rotate base on it's orbit style.
            switch (m_OrbitStyle)
            {
            // If the style is smooth add a torque to the camera's rigidbody.
            case OrbitStyle.Smooth:

                print("swiping left");
                m_Rigidbody.AddTorque(transform.up * increment);
                break;

            // If the style is step then rotate the camera's transform by a set amount.
            case OrbitStyle.Step:
                transform.Rotate(0, increment, 0);
                break;

            // If the style is step with a fade, wait for the camera to fade out, then step the rotation around, the wait for the camera to fade in.
            case OrbitStyle.StepWithFade:
                yield return(StartCoroutine(m_CameraFade.BeginFadeOut(m_RotationFadeDuration, false)));

                transform.Rotate(0, increment, 0);
                yield return(StartCoroutine(m_CameraFade.BeginFadeIn(m_RotationFadeDuration, false)));

                break;
            }
        }
Exemple #10
0
    public IEnumerator Movescene()
    {
        yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

        // Load the level.
        SceneManager.LoadScene("play1", LoadSceneMode.Single);
    }
        private IEnumerator ActivateButton()
        {
            // If the camera is already fading, ignore.
            if (m_CameraFade.IsFading)
            {
                yield break;
            }

            // If anything is subscribed to the OnButtonSelected event, call it.
            if (OnButtonSelected != null)
            {
                OnButtonSelected(this);
            }

            // Wait for the camera to fade out.
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            // Load the level.
            //SceneManager.LoadScene(m_SceneToLoad, LoadSceneMode.Single);
            m_videoController.IncrementVideo(next);

            yield return(new WaitForSeconds(1.5f));

            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(true)));
        }
    private IEnumerator FadeToMenu()
    {
        // Wait for the screen to fade out.
        yield return(StartCoroutine(m_VRCameraFade.BeginFadeOut(true)));

        // Load the main menu by itself.
        SceneManager.LoadScene(m_MenuSceneName, LoadSceneMode.Single);
    }
Exemple #13
0
        IEnumerator Outro()
        {
            m_BarFilled = true;
            StopCoroutine(m_LoopButtons);
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            SceneManager.LoadScene(m_SceneToLoad);
        }
    private IEnumerator FadeToLevel()
    {
        audioSource.clip = LevelCompletedAudioClip;
        audioSource.Play();
        // Wait for the screen to fade out.
        yield return(StartCoroutine(m_VRCameraFade.BeginFadeOut(true)));

        // Load the main menu by itself.
        SceneManager.LoadScene(LevelName, LoadSceneMode.Single);
    }
Exemple #15
0
        private IEnumerator EndPhase()
        {
            // Turn off the ability to set targets for the character.
            m_MazeTargetSetting.Deactivate();

            // Hide the reticle as it's not required at the moment.
            m_Reticle.Hide();

            // The reticle also controls the rotation for the selection radial so set it to use default rotation.
            m_Reticle.UseNormal = false;

            // Hide the destination marker as targets are no longer being set.
            m_DestinationMarker.Hide();

            // If the player won...
            if (m_Win)
            {
                // ... play the win particles and audio.
                m_WinParticles.Play(true);
                m_GameOverAudioSource.Play();

                // Wait for the particles to finish.
                yield return(new WaitForSeconds(m_WinParticles.main.duration));

                // Wait for the win UI to fade in.
                yield return(StartCoroutine(m_WinFader.InteruptAndFadeIn()));
            }
            else
            {
                // If the player didn't win wait for the lose UI to fade in.
                yield return(StartCoroutine(m_LoseFader.InteruptAndFadeIn()));
            }

            // The user needs to hold Fire1 to pass the UI so turn on double tap warnings.
            m_InputWarnings.TurnOnDoubleTapWarnings();

            // Wait for the radial to fill.
            yield return(StartCoroutine(m_SelectionRadial.WaitForSelectionRadialToFill()));

            // Turn the tap warnings back off.
            m_InputWarnings.TurnOffDoubleTapWarnings();

            // In order wait for the win and lose UI to fade out (only one should be faded in) then wait for the camera to fade out.
            yield return(StartCoroutine(m_WinFader.InteruptAndFadeOut()));

            yield return(StartCoroutine(m_LoseFader.InteruptAndFadeOut()));

            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            // Restart all the dependent scripts.
            Restart();

            // Wait for the screen tot fade back in.
            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(true)));
        }
Exemple #16
0
    public void Enter()
    {
        if (CurrentInput.Length < downLimit)
        {
            Debug.Log("az karakter uyarisi");
            return;
        }

        StartCoroutine(_cameraFade.BeginFadeOut(true));
        _userIDReady = true;
        PlayerPrefs.SetString("userID", _text.text);
        Debug.Log(PlayerPrefs.GetString("userID"));
    }
Exemple #17
0
        IEnumerator LoadNextScene()
        {
            //If the camera is already fading, ignore.
            if (m_CameraFade.IsFading)
            {
                yield break;
            }

            // Wait for the camera to fade out.
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            SceneManager.LoadScene(m_NextScene, LoadSceneMode.Single);
        }
Exemple #18
0
    private IEnumerator ActivateButton()
    {
        // If the camera is already fading, ignore.
        if (m_CameraFade.IsFading)
        {
            yield break;
        }

        // Wait for the camera to fade out.
        yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

        SceneManager.LoadScene("MainScene" + mSceneIndex.ToString(), LoadSceneMode.Single);
    }
Exemple #19
0
        private IEnumerator ActivateButton()
        {
            // If the camera is already fading, ignore.
            if (m_CameraFade.IsFading)
            {
                yield break;
            }

            // Wait for the camera to fade out.
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            // Load the level.
            SceneManager.LoadScene(m_SceneToLoad, LoadSceneMode.Single);
        }
Exemple #20
0
    // Update is called once per frame
    void Update()
    {
        RaycastHit hit;

        if (Physics.Raycast(transform.position, transform.forward, out hit, 1000))
        {
            if (Input.GetKeyDown(KeyCode.Mouse0))
            {
                if (hit.transform == _newUser)
                {
                    Debug.Log("newUser");
                    StartCoroutine(_cameraFade.BeginFadeOut(true));
                    SceneManager.LoadScene("LoginScreen");
                }
                if (hit.transform == _newScenerio)
                {
                    Debug.Log("newScenerio");
                    StartCoroutine(_cameraFade.BeginFadeOut(true));
                    SceneManager.LoadScene("MainMenu");
                }
            }
        }
    }
Exemple #21
0
    private IEnumerator ActivateButton()
    {
        // If the camera is already fading, ignore
        if (m_CameraFade.IsFading)
        {
            yield break;
        }
        // If anything is subscribed to the OnButtonSelected event, call it.
        if (OnButtonSelected != null)
        {
            OnButtonSelected(this);
        }
        // Wait for the camera to fade out.
        yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

        //set title
        title = this.name;

        // Load the level
        //SceneManager.LoadScene("play1", LoadSceneMode.Single);
        //SceneManager.LoadScene(m_SceneToLoad, LoadSceneMode.Single);
        //SceneManager.LoadScene("interval", LoadSceneMode.Single);
    }
    private IEnumerator FadeToScene(string sceneName, GameObject underlayVideo, GameObject underlayEnvironment)
    {
        if (Camera.main != null)
        {
            VRCameraFade cameraFade = Camera.main.gameObject.GetComponent <VRCameraFade>();
            if (cameraFade != null)
            {
                yield return(StartCoroutine(cameraFade.BeginFadeOut(false)));
            }
        }
        underlayVideo.gameObject.SetActive(false);
        underlayEnvironment.gameObject.SetActive(false);

        SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Single);
    }
Exemple #23
0
        private IEnumerator StartPhase()
        {
            // Make sure the Outro UI is not being shown and the intro UI is.
            StartCoroutine(m_UIController.ShowIntroUI());
            StartCoroutine(m_UIController.HideOutroUI());

            // To make sure the user is facing the right way show the arrows.
            m_GuiArrows.Show();

            // Turn off the fog whilst showing the intro.
            RenderSettings.fog = false;

            // Make sure the game is stopped for the flyer's health.
            m_HealthController.StopGame();

            // Since a selection slider is being used, hide the radial and show the reticle.
            m_SelectionRadial.Hide();
            m_Reticle.Show();

            // In order wait for the selection slider to fill, then the intro UI to hide, then the camera to fade out.
            yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_UIController.HideIntroUI()));

            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(m_IntroOutroFadeDuration, false)));

            // Once the screen has faded out, we can hide UI elements we don't want to see anymore like the arrows and reticle.
            m_GuiArrows.Hide();
            m_Reticle.Hide();

            // Turn the fog back on so spawned objects won't appear suddenly.
            RenderSettings.fog = true;

            // Now wait for the screen to fade back in.
            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(m_IntroOutroFadeDuration, false)));
        }
Exemple #24
0
        public IEnumerator LoadScene(SceneUtils.SceneType sceneType, VRCameraFade cameraFade)
        {
            //Set the previous scene name
            LevelManager.PreviousSceneType = SceneUtils.GetSceneType(SceneManager.GetActiveScene().name);

            if (cameraFade.IsFading)
            {
                yield break;
            }

            // Wait for the screen to fade out.
            yield return(StartCoroutine(cameraFade.BeginFadeOut(true)));

            // Load the main menu by itself.
            SceneManager.LoadScene(SceneUtils.GetSceneName(sceneType), LoadSceneMode.Single);
        }
    private IEnumerator ActivateFade()
    {
        // If the camera is already fading, ignore.
        if (m_CameraFade.IsFading)
        {
            yield break;
        }

        if (fadeOutOnSelect)
        {
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));
        }
        if (fadeInOnSelect)
        {
            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(true)));
        }
    }
Exemple #26
0
        private IEnumerator ActivateButton()
        {
            // If the camera is already fading, ignore.
            if (m_CameraFade.IsFading)
            {
                yield break;
            }

            // If anything is subscribed to the OnButtonSelected event, call it.
            if (OnButtonSelected != null)
            {
                OnButtonSelected(this);
            }

            // update static variable lectureNum
            LectureChooser.lectureNum = Int32.Parse(m_SceneToLoad);
            lectureChosen             = true;

            // check if lecture is downloaded
            // get path of lecture

            // Wait for the camera to fade out.
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            SceneManager.LoadScene("GearStereo360", LoadSceneMode.Single);

//			string lecturePath = Application.persistentDataPath + "/" + "week5_360_TB.mp4";
//			if (System.IO.File.Exists (lecturePath))
//			{
//				// lecture file exists already, play lecture
//				// TODO transition scene and play lecture
//				Debug.Log("lecture exists!");
//				// Wait for the camera to fade out.
//				yield return StartCoroutine(m_CameraFade.BeginFadeOut(true));
//				SceneManager.LoadScene ("GearStereo360", LoadSceneMode.Single);
//			}
//			else
//			{
//				// TODO prompt user to download lecture
//				// StartCoroutine(DownloadLecture());
//
//			}

            // Load the playLecture scene.
        }
Exemple #27
0
        /*
         * private void OnEnable ()
         * {
         *  m_InteractiveItem.OnOver += HandleOver;
         *  m_InteractiveItem.OnOut += HandleOut;
         *  m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete;
         * }
         *
         *
         * private void OnDisable ()
         * {
         *  m_InteractiveItem.OnOver -= HandleOver;
         *  m_InteractiveItem.OnOut -= HandleOut;
         *  m_SelectionRadial.OnSelectionComplete -= HandleSelectionComplete;
         * }
         *
         *
         * private void HandleOver()
         * {
         *  // When the user looks at the rendering of the scene, show the radial.
         *  m_SelectionRadial.Show();
         *
         *  m_GazeOver = true;
         * }
         *
         *
         * private void HandleOut()
         * {
         *  // When the user looks away from the rendering of the scene, hide the radial.
         *  m_SelectionRadial.Hide();
         *
         *  m_GazeOver = false;
         * }
         *
         *
         * private void HandleSelectionComplete()
         * {
         *  // If the user is looking at the rendering of the scene when the radial's selection finishes, activate the button.
         *  if(m_GazeOver)
         *      StartCoroutine (ActivateButton());
         * }
         */

        private IEnumerator ChangeScene()
        {
            Debug.Log("entrou");
            // If the camera is already fading, ignore.
            if (m_CameraFade.IsFading)
            {
                Debug.Log("foi pro primeiro if");
                yield break;
            }


            // Wait for the camera to fade out.
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            // Load the level.
            SceneManager.LoadScene(m_SceneToLoad, LoadSceneMode.Single);
            Debug.Log("loading scene");
        }
Exemple #28
0
    private IEnumerator FadeToNewScene()
    {
        // If the camera is already fading, ignore.
        if (m_CameraFade.IsFading)
        {
            yield break;
        }

        // If anything is subscribed to the OnButtonSelected event, call it.
        if (OnButtonSelected != null)
        {
            OnButtonSelected(this);
        }

        // Wait for the camera to fade out.
        yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

        // Load the level.
        SceneManager.LoadScene(m_SceneToLoad, LoadSceneMode.Single);
    }
Exemple #29
0
        private IEnumerator ActivateButton()
        {
            // If the camera is already fading, ignore.
            if (m_CameraFade.IsFading)
            {
                yield break;
            }

            // If anything is subscribed to the OnButtonSelected event, call it.
            if (OnButtonSelected != null)
            {
                OnButtonSelected(this);
            }

            // Wait for the camera to fade out.
            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

            // Quit the game.
            Application.Quit();
        }
Exemple #30
0
        private IEnumerator ActivateButton()
        {
            if (OnButtonSelected != null)
            {
                OnButtonSelected(this);
            }


            if (SceneManager.GetActiveScene().buildIndex == 0)
            {
                if (m_CameraFade.IsFading)
                {
                    yield break;
                }
                yield return(StartCoroutine(m_CameraFade.BeginFadeOut(true)));

                SceneManager.LoadScene("Asite", LoadSceneMode.Single);
            }
            else if (SceneManager.GetActiveScene().buildIndex == 1)
            {
            }
        }