// Update is called once per frame void Update() { if (Input.anyKey && transition) { TransitionLevel.GoToNextLevel(); } }
public IEnumerator FadeTextToNoAlpha() { text.color = new Color(text.color.r, text.color.g, text.color.b, 1); while (text.color.a > 0f) { text.color = new Color(text.color.r, text.color.g, text.color.b, text.color.a - (Time.deltaTime / time)); yield return(null); } if (transition) { TransitionLevel.GoToNextLevel(); } else { yield return(new WaitForSeconds(delay)); StartCoroutine(FadeTextToFullAlpha()); } }