コード例 #1
0
        private void Reset()
        {
            foreach (var property in properties)
            {
                TweenDataHolder.pool.PutObject(property.Value);
            }

            properties.Clear();

            prev    = null;
            next    = null;
            chain   = null;
            target  = null;
            manager = null;

            _startHandler         = null;
            _startParamHandler    = null;
            _updateHandler        = null;
            _updateParamHandler   = null;
            _completeHandler      = null;
            _completeParamHandler = null;
            _easing                = null;
            _targetAsIReusable     = null;
            _targetAsIActiveObject = null;
        }
コード例 #2
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));
 }
コード例 #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);
 }
コード例 #4
0
        internal void Activate()
        {
            InitializeProperties();

            isActive = true;

            if (_easing == null)
            {
                _easing = manager.defaultEasing;
            }

            if (_startHandler != null)
            {
                _startHandler();
            }

            if (_startParamHandler != null)
            {
                _startParamHandler(target);
            }
        }
コード例 #5
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);
        }
コード例 #6
0
 /// <summary>
 /// Sets an easing equation. Flunity.Easing namespace
 /// </summary>
 public Tweener Easing(EasyFunction value)
 {
     _easing = value;
     return(this);
 }