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 MenuStart() { buttonHandler.SetAllowButton(false); fadeController.setFadeDuration(1.0f); fadeController.StartCoroutine(fadeController.FadeIn()); Invoke("EnableMenu", 0.5f); }
void FadeIn() { allowButton = false; fadeController.setFadeDuration(1.0f); fadeController.StartCoroutine(fadeController.FadeIn()); Invoke("EnableMenu", 0.5f); }
void OnCollisionEnter(Collision col) { if (col.gameObject.CompareTag("Player") && playerInputController.numberOfEnemies < 1) { fadeInOut.FadeIn(); // playerInputController.SetIdle(); } }
public void FadeIn(bool activeState, float time, System.Action action) { FadeInOut fade = Get <FadeInOut>(UIList.FadeInOut); if (fade != null) { fade.FadeIn(activeState, time, action); } }
private IEnumerator Show() { for (int i = 0; i < renderers.Length; ++i) { renderers[i].enabled = true; } fadeComponent.FadeIn(fadeDuration); yield return(new WaitForSeconds(fadeDuration)); activeCoroutine = null; }
void Update() { if (Input.GetKeyDown(KeyCode.A)) { StartCoroutine(m_Fade.FadeOut()); } else if (Input.GetKeyDown(KeyCode.D)) { StartCoroutine(m_Fade.FadeIn()); } }
private void CheckEnter() { // Only check enter if the room is the current room. if (!selected) { return; } if (visited) { fadeInOut.FadeIn("fast"); } else { fadeInOut.FadeIn("slow"); } if (OnEnter != null) { OnEnter(); } }
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); }
// Use this for initialization void Start() { sceneFader.FadeIn(); }
void DoFadeOut() { fadeOutObject.SetActive(true); fadeOut.FadeIn(); }
public void FadeIn() { fadeInOut.FadeIn(); }
public void stageStart() { // - Show Stage # fadeController.setFadeDuration(2.0f); fadeController.StartCoroutine(fadeController.FadeIn()); }
void Start() { fader = GameObject.FindGameObjectWithTag("Fader").GetComponent <FadeInOut>(); StartCoroutine(fader.FadeIn()); }
public void FadeIn() { StartCoroutine(fader.FadeIn()); }
public void ChangeSceneLossGame() { fade.FadeIn("MainMenu"); }
void Start() { fader = GameObject.FindGameObjectWithTag("Fader").GetComponent<FadeInOut>(); StartCoroutine(fader.FadeIn()); }
public void MakeFound() { isFound = true; roomScript.roomReady = true; // Once this container fades in, we'll need to reactivate the room. fadeInOut.FadeIn("slow"); }