Example #1
0
        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));
        }
Example #2
0
        // 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));
        }
Example #3
0
        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));
        }
Example #4
0
        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));
        }
Example #5
0
        // 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));
        }
Example #6
0
 public static void KillTweens(this Component owner)
 {
     Tweener.KillTweens(owner);
 }
Example #7
0
        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));
        }
Example #8
0
        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));
        }
Example #9
0
        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));
        }