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))); }
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 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; } }
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 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))); }
void OnShowResult(string s, bool showIt) { if (showIt) { RenderSettings.skybox = ui; StartCoroutine(vrCameraFade.BeginFadeIn(0.5f, false)); } }
IEnumerator StartAgainReoutine() { ball.SetActive(true); yield return(new WaitForSeconds(0.2f)); state = states.ON_AIMING; SetFloors(true); Events.OnShowResult("", false); yield return(StartCoroutine(vrCameraFade.BeginFadeIn(1, false))); }
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))); }
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))); }
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))); } }