public static Tweener MoveTo(this Transform t, Vector3 position, float duration, Func <float, float, float, float> equation) { TransformPositionTweener tweener = t.gameObject.AddComponent <TransformPositionTweener> (); tweener.startTweenValue = t.position; tweener.endTweenValue = position; tweener.duration = duration; tweener.equation = equation; tweener.Play(); return(tweener); }
public static Tweener MoveToUsingCurve(this Transform t, Vector3 position, float duration, AnimationCurve curve) { TransformPositionTweener tweener = t.gameObject.AddComponent <TransformPositionTweener>(); tweener.StartTweenValue = t.position; tweener.EndTweenValue = position; tweener.duration = duration; tweener.curve = curve; tweener.useAnimationCurve = true; tweener.Play(); return(tweener); }