IEnumerator FadeOut(TextMeshProUGUI text)
        {
            float t = 0;
            Color c = text.color;

            while (t < 1)
            {
                t         += Time.deltaTime * 2;
                c.a        = Curves.QuadEaseInOut(1, 0, Mathf.Clamp01(t));
                text.color = c;
                yield return(null);
            }
            c.a        = 1;
            text.color = c;
        }
Esempio n. 2
0
    IEnumerator Scale(float start, float end, float time)
    {
        float t = 0;

        while (t < 1)
        {
            t += Time.deltaTime / time;

            float s = Curves.QuadEaseInOut(start, end, t);

            transform.localScale = s * Vector3.one;

            yield return(null);
        }

        transform.localScale = end * Vector3.one;
    }