IEnumerator _CrossDoor(UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter character) { fade.FadeIn(); while (fade.IsFading()) { yield return null; } Vector3 posicionDestino = _spawnPoint.transform.position; Vector3 rotacionDestino = _spawnPoint.transform.eulerAngles; agent.enabled = false; character.transform.position = posicionDestino; character.transform.eulerAngles = rotacionDestino; agent.enabled = true; SceneManager.UnloadSceneAsync(sceneToUnload); AsyncOperation ao = SceneManager.LoadSceneAsync(sceneToload, LoadSceneMode.Additive); while (!ao.isDone) { yield return null; } fade.FadeOut(); GameObject.Find("Button").GetComponent<Click>().GetPosicionActual(posicion); GameObject.Find("Sarah").GetComponent<AICharacterControl>().SetTarget(posicionDestino); }
IEnumerator _CrossDoor(UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter character) { fade.FadeIn(); while (fade.IsFading()) { yield return(null); } Vector3 posicionDestino = _spawnPoint.transform.position; Vector3 rotacionDestino = _spawnPoint.transform.eulerAngles; character.transform.position = posicionDestino; character.transform.eulerAngles = rotacionDestino; SceneManager.UnloadSceneAsync(sceneToUnload); AsyncOperation ao = SceneManager.LoadSceneAsync(sceneToload, LoadSceneMode.Additive); while (!ao.isDone) { yield return(null); } fade.FadeOut(); }
// Update is called once per frame IEnumerator Splash() { float elapsed = 0; float time = 1; gameObject.GetComponent <AudioSource>().Play(); while (elapsed < time) { f.FadeOut(1, 1); yield return(new WaitForSeconds(1)); elapsed++; } SceneManager.LoadScene(1); }
IEnumerator AcionarPorta() { fade.FadeIn(); yield return(new WaitWhile(() => fade.fume.color.a < 0.9f)); _PlayerScript.gameObject.SetActive(false); switch (escuro) { case true: _PlayerScript.ChangeMaterial(luz2D); break; case false: _PlayerScript.ChangeMaterial(padrao2D); break; } _PlayerScript.transform.position = destino.position; yield return(new WaitForSeconds(0.3f)); _PlayerScript.gameObject.SetActive(true); fade.FadeOut(); }
public void NewGame() { f.FadeOut(0.5f, 2); }
private void Start() { fade = FindObjectOfType(typeof(fade)) as fade; fade.FadeOut(); }