Esempio n. 1
0
        IEnumerator Fade(GUIText text)
        {
            float counter = 0;

            yield return(new WaitForSeconds(LifeTime));

            while (counter < FadeOutTime && text != null)
            {
                counter += Time.deltaTime;
                text.SetColor((1 - (counter / FadeOutTime)) * Alpha, "A");
                yield return(null);
            }

            if (text != null)
            {
                text.SetColor(0, "A");
                RemoveLine(text);
            }
        }
 public static void SetColor(this GUIText guiText, float color, string channels)
 {
     guiText.SetColor(new Color(color, color, color, color), channels);
 }