Пример #1
0
        public override bool Update()
        {
            if (isPaused)
            {
                return(false);
            }

            if (currentTweenIndex >= tweenList.Count)
            {
                return(true);
            }

            ITweenable tween = tweenList[currentTweenIndex];

            if (tween.Update())
            {
                currentTweenIndex++;
                if (currentTweenIndex == tweenList.Count)
                {
                    if (completionHandler != null)
                    {
                        completionHandler(this);
                    }
                    isCurrentlyManagedBySynTween = false;
                    return(true);
                }
                else
                {
                    tweenList[currentTweenIndex].Start();
                }
            }

            return(false);
        }
Пример #2
0
        private void Update()
        {
            isUpdating = true;

            tempTweens.Clear();
            tempTweens.AddRange(activeTweens);
            for (int i = 0; i < tempTweens.Count; i++)
            {
                ITweenable tween = tempTweens[i];

                if (removedTweens.Contains(tween))
                {
                    continue;
                }

                if (tween.Update())
                {
                    // If true, the tween has completed.
                    tween.RecycleSelf();
                    activeTweens.Remove(tween);
                }
            }

            removedTweens.Clear();

            isUpdating = false;
        }