Esempio n. 1
0
 private void StartNextTween()
 {
     if (this.chainInternal.Count > 0)
     {
         this.currentItem = this.chainInternal[this.currentIndex].StartTween();
         this.currentIndex++;
     }
 }
Esempio n. 2
0
        /// <summary>
        ///     Maintains the current chain but puts us back at the beginning
        /// </summary>
        public void Refresh()
        {
            this.currentIndex = 0;
            this.currentItem  = null;
            var chainCopy = new List <IChainItem>(this.chainInternal);

            foreach (var item in chainCopy)
            {
                item.Refresh();
            }

            StartNextTween();
        }
Esempio n. 3
0
        public void Update(float dt)
        {
            if (this.currentItem == null && this.chainInternal.Count > this.currentIndex)
            {
                StartNextTween();
            }

            if (this.currentItem != null)
            {
                this.currentItem.Update(dt);

                if (this.currentItem.IsComplete)
                {
                    this.currentItem = null;
                    // We recurse to queue up next item, this has a few interesting consequences:
                    // 1) callbacks execute instantly, therefore:
                    // 2) callbacks that queue up additional callbacks with no delay will infinite loop
                    Update(dt);
                }
            }
        }
Esempio n. 4
0
 public TweenChain Append(IChainItem item)
 {
     this.chainInternal.Add(item);
     return(this);
 }
Esempio n. 5
0
 public void Clear()
 {
     this.chainInternal.Clear();
     this.currentIndex = 0;
     this.currentItem  = null;
 }
Esempio n. 6
0
 /// <summary>
 ///     Skip to the end of the tween, skipping everything in between
 /// </summary>
 public void SkipToEnd()
 {
     this.currentIndex = this.chainInternal.Count;
     this.currentItem  = null;
 }
Esempio n. 7
0
 public CoR <TContext> AddNext(IChainItem <TContext> chainItem)
 {
     Chain.Enqueue(chainItem);
     return(this);
 }