Пример #1
0
 public override void Play()
 {
     if (_currentTweenHandle == null && _tweenList.Count > 0 && _index == 0)
     {
         _currentTweenHandle = _tweenList[_index++];
         _currentTweenHandle.AddOnStartedListener(OnTweenStarted);
         _currentTweenHandle.Play();
     }
     else
     {
         _currentTweenHandle?.Play();
     }
 }
        internal override void QueueTweenHandleAction(TweenHandle tweenHandle)
        {
            var index = _tweenBatchHandles.IndexOf(tweenHandle);

            if (index >= 0)
            {
                _tweenHandleActionEventQueue.Enqueue(new TweenHandleAction
                {
                    actionType = tweenHandle.actionType,
                    index      = index
                });
            }
            else
            {
                Debug.LogWarning(RuntimeConstants.HANDLE_BATCH_NOT_FOUND);
            }
        }
Пример #3
0
        public override void Rewind()
        {
            for (var i = 0; i < _tweenList.Count; i++)
            {
                _tweenList[i].Rewind();
            }

            if (_tweenList.Count > 0)
            {
                _index = 1;
                _currentTweenHandle = _tweenList[0];
            }
            else
            {
                _index = 0;
            }
        }
Пример #4
0
        protected TweenHandle GetNextAvailableTweenHandle()
        {
            TweenHandle tweenAccessor;

            if (_tweenHandlePool.Count > 0)
            {
                tweenAccessor = _tweenHandlePool.First.Value;
                tweenAccessor.Reset();

                _tweenHandlePool.RemoveFirst();
            }
            else
            {
                tweenAccessor = new TweenHandle(this);
            }

            return(tweenAccessor);
        }
Пример #5
0
        private void OnTweenCompleted()
        {
            if (_tweenList.Count == 0)
            {
                return;
            }

            if (_index > _tweenList.Count - 1)
            {
                _onComplete?.Invoke();
            }
            else
            {
                _currentTweenHandle = _tweenList[_index++];
                _currentTweenHandle.Play();

                _onStep?.Invoke();
            }
        }
Пример #6
0
 internal abstract void QueueTweenHandleAction(TweenHandle tweenHandle);