Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #6
0
 public static void KillTweens(this Component owner)
 {
     Tweener.KillTweens(owner);
 }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }