// Start is called before the first frame update void Start() { fade = FindObjectOfType(typeof(fade)) as fade; fade.fadeOut(); DontDestroyOnLoad(this.gameObject); }
IEnumerator trocaScena() { fade.fadeIn(); yield return(new WaitWhile(() => fade.fume.color.a < 1f)); if (destino == "titulo") { Destroy(gameControler.gameObject); } SceneManager.LoadScene(destino); fade.fadeOut(); }
IEnumerator acionarPorta() { fade.fadeIn(); yield return(new WaitWhile(() => fade.fume.color.a < 1f)); if (luz) { scriptPlayer.AlteraMaterial(luzPadrao); } else { scriptPlayer.AlteraMaterial(LuzDiffusa); } scriptPlayer.transform.position = destino.position; fade.fadeOut(); }
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.5f)); playerScript.gameObject.SetActive(true); fade.fadeOut(); }
void Start() { fade = FindObjectOfType (typeof(fade)) as fade; fade.fadeOut (); }