Exemplo n.º 1
0
 public static Tweener Tween <TTarget, TValue>(
     this TTarget target,
     int duration,
     ITweenProperty <TValue> property,
     TValue to,
     EasyFunction easing = null) where TTarget : class
 {
     Debug.Assert(target != null, "target is null");
     return(TweenManager.instance.Tween(target, duration, property, to, easing));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Add property to animate
        /// </summary>
        public Tweener Add <T>(ITweenProperty <T> property, T endValue)
        {
            if (properties.ContainsKey(property))
            {
                return(this);
            }

            var tweenData = TweenDataHolder.pool.GetObject();

            property.WriteValue(tweenData.endValue, endValue);
            properties[property] = tweenData;
            return(this);
        }
Exemplo n.º 3
0
 public Tweener Chain <TValue>(
     int duration,
     ITweenProperty <TValue> property,
     TValue endValue,
     EasyFunction easing = null)
 {
     chain = pool.GetObject();
     chain.Initialize(manager, target);
     chain.Duration(duration);
     chain.Add(property, endValue);
     if (easing != null)
     {
         chain.Easing(easing);
     }
     return(chain);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Creates new Tweener
        /// </summary>
        public Tweener Tween <TTarget, TValue>(
            TTarget target,
            int duration,
            ITweenProperty <TValue> property,
            TValue to,
            EasyFunction easing = null) where TTarget : class
        {
            var tweener = Tween(target);

            if (duration >= 0)
            {
                tweener.Duration(duration);
            }

            if (easing != null)
            {
                tweener.Easing(easing);
            }

            tweener.Add(property, to);

            return(tweener);
        }