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); }
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); }
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); }