public ChainItem(T destination, float duration, EaseFunc scaleFunc, TweenAccessors <T> accessors, LerpFunc <T> lerp) { this.destination = destination; this.duration = duration; this.scaleFunc = scaleFunc; this.accessors = accessors; this.lerpFunc = lerp; this.tween = new Tween <T>(this.lerpFunc); }
public TweenChain AppendPointTween(Point targetVal, float duration, EaseFunc easeFunc, TweenAccessors <Point> accessors) { return(Append(new ChainItem <Point>(targetVal, duration, easeFunc, accessors, TweenChain.PointLerp))); }
public TweenChain AppendVectorTween(Vector2 targetVal, float duration, EaseFunc easeFunc, TweenAccessors <Vector2> accessors) { return(Append(new ChainItem <Vector2>(targetVal, duration, easeFunc, accessors, Vector2.Lerp))); }
public TweenChain AppendIntTween(int targetVal, float duration, EaseFunc easeFunc, TweenAccessors <int> accessors) { return(Append(new ChainItem <int>(targetVal, duration, easeFunc, accessors, TweenChain.LerpInt))); }
/* * This would work if we had a way to obtain a LerpFunction for a type * public TweenChain Append<T>(T targetVal, float duration, EaseFunc easeFunc, TweenAccessors<T> accessors) where T : struct * { * return Append(new ChainItem<T>(targetVal, duration, easeFunc, accessors, GetLerpFunction<T>())); * } */ public TweenChain AppendFloatTween(float targetVal, float duration, EaseFunc easeFunc, TweenAccessors <float> accessors) { return(Append(new ChainItem <float>(targetVal, duration, easeFunc, accessors, FloatTween.LerpFloat))); }