public static ITween TweenScale(this Transform owner, Vector3 target, float duration) { Vector3TweenState state = TweenPool.V3.Get(s => s.Init(owner.localScale, v => owner.localScale = v, target)); return(Tweener.Create(owner, state, duration)); }
// RectTransform public static ITween TweenAnchorPos(this RectTransform owner, Vector2 target, float duration) { Vector2TweenState state = TweenPool.V2.Get(s => s.Init(owner.anchoredPosition, v => owner.anchoredPosition = v, target)); return(Tweener.Create(owner, state, duration)); }
public static ITween Delay(this Component owner, float delay, Action action) { FloatTweenState state = TweenPool.Float.Get(s => s.Init(0, _ => {}, 0)); return(Tweener.Create(owner, state, 0).SetDelay(delay).OnComplete(action)); }
public static ITween TweenRotation(this Transform owner, Quaternion target, float duration) { QuaternionTweenState state = TweenPool.Quaternions.Get(s => s.Init(owner.rotation, v => owner.rotation = v, target)); return(Tweener.Create(owner, state, duration)); }
// CanvasGroup public static ITween TweenAlpha(this CanvasGroup owner, float target, float duration) { FloatTweenState state = TweenPool.Float.Get(s => s.Init(owner.alpha, x => owner.alpha = x, target)); return(Tweener.Create(owner, state, duration)); }
public static void KillTweens(this Component owner) { Tweener.KillTweens(owner); }
public static ITween Tween(this Component owner, Func <Vector3> get, Action <Vector3> set, Vector3 target, float duration) { Vector3TweenState state = TweenPool.V3.Get(s => s.Init(get(), set, target)); return(Tweener.Create(owner, state, duration)); }
public static ITween Tween(this Component owner, Func <float> get, Action <float> set, float target, float duration) { FloatTweenState state = TweenPool.Float.Get(s => s.Init(get(), set, target)); return(Tweener.Create(owner, state, duration)); }
public static ITween TweenPivot(this RectTransform owner, Vector2 target, float duration) { Vector2TweenState state = TweenPool.V2.Get(s => s.Init(owner.pivot, v => owner.pivot = v, target)); return(Tweener.Create(owner, state, duration)); }