예제 #1
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenGradientColor Begin(GameObject go, float duration, Gradient gradient)
    {
#if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            return(null);
        }
#endif
        TweenGradientColor comp = UITweener.Begin <TweenGradientColor>(go, duration);
        comp.gradient = gradient;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
예제 #2
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenGradientColor Begin(GameObject go, float duration, Color colorTop, Color colorBottom)
    {
#if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            return(null);
        }
#endif
        TweenGradientColor comp = UITweener.Begin <TweenGradientColor>(go, duration);
        comp.topFrom = comp.topValue;
        comp.topTo   = colorTop;

        comp.bottomFrom = comp.bottomValue;
        comp.bottomTo   = colorBottom;


        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }