Beispiel #1
0
    public static IEnumerator ExpoFade(Image target, float start, float end, float animationTime)
    {
        float elapsedTime = 0;
        Color c           = Color.white;

        while (elapsedTime < animationTime)
        {
            c.a = PennerAnimation.ExpoEaseIn(
                elapsedTime,
                start,
                end - start,
                animationTime
                );
            target.color = c;
            elapsedTime += Time.deltaTime;
            yield return(0);
        }
        c.a          = end;
        target.color = c;
    }