Exemplo n.º 1
0
        virtual protected void TweenFirst()
        {
            Tweener tweenBack = null;

            if (_machineConfig.tweenFirstBackInfo.distance > 0)
            {
                var backPos = _symbolContainer.position + new Vector3(0f, _machineConfig.tweenFirstBackInfo.distance, 0f);
                tweenBack = _symbolContainer.DOMove(backPos, _machineConfig.tweenFirstBackInfo.duration);
                tweenBack.SetEase(Ease.OutSine);
                _spinDis += _machineConfig.tweenFirstBackInfo.distance;
            }

            AddSpinningSymbols(_machineConfig.SpinningSymbolCount);
            CheckTopChildSymbol();
            UpdateSpinDestination();

            var duration = _spinDis / _machineConfig.SpinSpeedPerSec;
            var tween    = _symbolContainer.DOLocalMove(_spinDestination, duration);

            // tween.SetEase(Ease.Linear);
            tween.SetEase(Ease.InCubic);

            //todo
            //시퀀스 매 생성하지 않고 재활용 하기
            var      startDelay         = StartOrder * _machineConfig.DelayEachSpin;
            Sequence firstTweenSequence = DOTween.Sequence();

            firstTweenSequence.PrependInterval(startDelay);
            if (tweenBack != null)
            {
                firstTweenSequence.Append(tweenBack);
            }
            firstTweenSequence.Append(tween);
            firstTweenSequence.AppendCallback(SpinReel).Play();

            _spinTween = firstTweenSequence;
        }