示例#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);