public static Tweener ScaleTo(this Transform t, Vector3 scale, float duration, Func <float, float, float, float> equation)
    {
        TransformScaleTweener tweener = t.gameObject.AddComponent <TransformScaleTweener>();

        tweener.startValue             = t.localScale;
        tweener.endValue               = scale;
        tweener.easingControl.duration = duration;
        tweener.easingControl.equation = equation;
        tweener.easingControl.Play();
        return(tweener);
    }
예제 #2
0
        public static EaseTweener ScaleTo(this Transform t, Vector3 scale, float duration, Func <float, float, float, float> animProperties)
        {
            TransformScaleTweener tweener = t.gameObject.AddComponent <TransformScaleTweener>();

            tweener.originValue                  = t.localScale;
            tweener.finalValue                   = scale;
            tweener.controller.duration          = duration;
            tweener.controller.animatePreperties = animProperties;
            tweener.controller.play();
            return(tweener);
        }
예제 #3
0
    public static Tweener ScaleToUsingCurve(this Transform t, Vector3 scale, float duration, AnimationCurve curve)
    {
        TransformScaleTweener tweener = t.gameObject.AddComponent <TransformScaleTweener>();

        tweener.StartTweenValue   = t.localScale;
        tweener.EndTweenValue     = scale;
        tweener.duration          = duration;
        tweener.curve             = curve;
        tweener.useAnimationCurve = true;
        tweener.Play();
        return(tweener);
    }