Example #1
0
    // 텍스트 FadeOut
    public void TextFadeOut(float time, ref Text txt)
    {
        FadeInfoTxt info = new FadeInfoTxt();

        info.time      = time;
        info.save_time = 0.0f;
        info.txt       = txt;
        info.rate      = txt.color.a;
        StartCoroutine("TextFadeOutC", info);
    }
Example #2
0
    IEnumerator TextFadeOutC(FadeInfoTxt info)
    {
        info.save_time += Time.unscaledDeltaTime;
        if (info.txt != null)
        {
            if (info.save_time < info.time)
            {
                float rate = (info.save_time / info.time) * info.rate;
                info.txt.color = new Color(info.txt.color.r, info.txt.color.g, info.txt.color.b, 1 - rate);
                yield return(null);

                StartCoroutine("TextFadeOutC", info);
            }
            else
            {
                info.txt.color = new Color(info.txt.color.r, info.txt.color.g, info.txt.color.b, 0);
            }
        }
    }