Example #1
0
    public static TweenAlpha AddTween(GameObject target, float from, float to, float duration, Keyframe[] keys)
    {
        TweenAlpha tweener = target.AddComponent <TweenAlpha>();

        tweener.Target     = target;
        tweener.From       = from;
        tweener.To         = to;
        tweener.Duration   = duration;
        tweener.Curve      = new AnimationCurve();
        tweener.Curve.keys = keys;

        tweener.Initialise();

        return(tweener);
    }