public void LoadLevelWithFade(string name) { if (sound != null) { sound.Play(); } sceneFader.FadeOut(); screenToChangeTo = name; screenChangeTime = sceneFader.fadeDuration + 0.5f; }
public void FadeOut() { if (fadeout) { fadeInOut.FadeOut(); } }
void Update() { if (allowFade) { StartCoroutine(m_FadeInOut.FadeOut()); allowFade = false; } }
public void FadeOut(bool activeState, float time, System.Action action) { FadeInOut fade = Get <FadeInOut>(UIList.FadeInOut); if (fade != null) { fade.FadeOut(activeState, time, action); } }
void Update() { if (Input.GetKeyDown(KeyCode.A)) { StartCoroutine(m_Fade.FadeOut()); } else if (Input.GetKeyDown(KeyCode.D)) { StartCoroutine(m_Fade.FadeIn()); } }
private IEnumerator Hide() { fadeComponent.FadeOut(fadeDuration); yield return(new WaitForSeconds(fadeDuration)); for (int i = 0; i < renderers.Length; ++i) { renderers[i].enabled = false; } activeCoroutine = null; }
internal IEnumerator StartSecondPhase() { firstPhase = false; state = State.Changing; anim.SetTrigger("Stopping"); StartCoroutine(SimulateJump(false, 90, 0, 60, 2.25f)); yield return(new WaitForSeconds(1f)); List <Transform> crystalsBroken = new List <Transform>(); foreach (Transform crystal in crystals) { crystalsBroken.Add(Instantiate(crystalBroken, crystal.position, Quaternion.identity)); Destroy(crystal.gameObject); // Rigidbody c = crystal.gameObject.GetComponent<Rigidbody>(); // c.isKinematic = false; // c.AddForce(new Vector3(Random.Range(-1000, 1000f), -50, Random.Range(-1000, 1000f))); } yield return(new WaitForSeconds(3)); // foreach (Transform crystal in crystals) // crystal.gameObject.SetActive(false); fade.FadeIn(false); yield return(new WaitForSeconds(2.7f)); foreach (Transform crystal in crystalsBroken) { int r = Random.Range(0, 5); if (r != 3) { crystal.gameObject.SetActive(false); } } defaultTerrain.gameObject.SetActive(false); northTerrain.gameObject.SetActive(true); southTerrain.gameObject.SetActive(true); northTerrain.position = new Vector3(northTerrain.position.x, 26, northTerrain.position.z); player.position = new Vector3(-50, 1.5f, 0); // transform.position = new Vector3(-131, 1.94f, transform.position.z); transform.position = new Vector3(tailPoint2.position.x - 20, tailPoint2.position.y + 26, tailPoint2.position.z); transform.LookAt(player); // transform.position += Vector3.up * 26; StartCoroutine(playerScript.CameraShaker2(1, .5f, .5f)); fade.FadeOut(); foreach (GameObject skull in skulls) { Destroy(skull); } yield return(new WaitForSeconds(2)); StartCoroutine(JumpOver()); }
public void MoveHome() { if (m_StaticMember.Days == 10 && EnddImg != null) { if (m_StaticMember.cntAmountFail >= 4) { EnddImg.gameObject.SetActive(true); EnddImg.color = new Color(1f, 0f, 0f, 0.75f); StartCoroutine(Wait()); Application.Quit(); } else { EnddImg.gameObject.SetActive(true); EnddImg.color = new Color(0f, 0f, 0f, 0.75f); StartCoroutine(Wait()); Application.Quit(); } } if (PlayerCtrl.kill < iCheckAll) { if (m_StaticMember != null) { m_StaticMember.cntAmountFail++; } } else if (PlayerCtrl.kill == iCheckAll) { if (m_StaticMember != null) { m_StaticMember.SizeOfHungryGauge += 10; } } if (m_StaticMember != null) { m_StaticMember.Buffer = System.Convert.ToByte("0000", 2); m_StaticMember.Days++; } PlayerCtrl.plrhungry = m_StaticMember.SizeOfHungryGauge; PlayerCtrl.kill = 0; StartCoroutine(m_FadeInOut.FadeOut()); }
private IEnumerator FadeCoroutine(float fadeInDuration, float lifetime, float fadeOutDuration) { FadeInOut fade = GetComponent <FadeInOut>(); currentLifeTime = 0f; fade.FadeIn(fadeInDuration); yield return(new WaitForSeconds(fadeInDuration)); while (currentLifeTime < lifetime) { yield return(null); currentLifeTime += Time.deltaTime; } fade.FadeOut(fadeOutDuration); yield return(new WaitForSeconds(fadeInDuration)); Destroy(gameObject); }
public void StageEnd() { fadeController.setFadeDuration(2.0f); fadeController.StartCoroutine(fadeController.FadeOut()); }
public void FadeOut() { StartCoroutine(fader.FadeOut()); }
private void HideContainer() { fadeInOut.FadeOut("fast"); }
void DoFadeIn() { fadeInObject.SetActive(true); fadeIn.FadeOut(); }
public void FadeOut() { fadeInOut.FadeOut(); }
public void OnEnterGame() { StartCoroutine(m_FadeInOut.FadeOut()); }
public void MenuChange() { buttonHandler.SetAllowButton(false); fadeController.setFadeDuration(1f); fadeController.StartCoroutine(fadeController.FadeOut()); }
void FadeOut() { allowButton = false; fadeController.setFadeDuration(2.0f); fadeController.StartCoroutine(fadeController.FadeOut()); }
private void StartGame() { pThisButtonAni.Stop(); StartCoroutine(pScriptTempObject.FadeOut()); }