Exemplo n.º 1
0
        public void Init()
        {
            _titleSeq = DOTween.Sequence();

            _titleText.DOFade(0, 0);

            DOTweenTMPAnimator tmpAniamtor = new DOTweenTMPAnimator(_titleText);


            for (int i = 0; i < tmpAniamtor.textInfo.characterCount; i++)
            {
                var charSeq = DOTween.Sequence();

                tmpAniamtor.DOScaleChar(i, 0.7f, 0);

                Vector3 currentCharOffset = tmpAniamtor.GetCharOffset(i);

                charSeq
                .Append(tmpAniamtor.DOOffsetChar(i, currentCharOffset + new Vector3(0, 60, 0), 0.4f * aaa).SetEase(Ease.OutFlash, 2))
                .Join(tmpAniamtor.DOFadeChar(i, 1, 0.4f * aaa))
                .Join(tmpAniamtor.DOScaleChar(i, 1, 0.4f * aaa).SetEase(Ease.OutBack))
                .SetDelay(0.07f * i * aaa);

                _titleSeq.Join(charSeq);
            }

            _titleSeq.OnComplete(() =>
            {
                Doozy.Engine.GameEventMessage.SendEvent("TitleAniamtionComplete");
            });

            _titleSeq.Play();
        }
Exemplo n.º 2
0
        private Sequence SetBonusSequence(int score)
        {
            _restItemCount.text = "BONUS +" + score;

            _onBonusTweenEnd = new Subject <Unit>();

            var seq = DOTween.Sequence();

            seq.Append(_restItemCount.DOFade(0, 0));

            var tmproAnimator = new DOTweenTMPAnimator(_restItemCount);

            for (int i = 0; i < tmproAnimator.textInfo.characterCount; i++)
            {
                Vector3 currCharOffset = tmproAnimator.GetCharOffset(i);

                var charSeq = DOTween.Sequence();

                charSeq.Append(tmproAnimator.DOFadeChar(i, 0.45f, 0.45f));
                charSeq.Join(tmproAnimator.DOOffsetChar(i, currCharOffset + new Vector3(0, 30f, 0), 0.25f).SetEase(Ease.OutFlash, 2));

                seq.Join(charSeq.SetDelay(i * 0.1f));
            }

            seq.OnComplete(() =>
            {
                _onBonusTweenEnd.OnNext(Unit.Default);
                _onBonusTweenEnd.OnCompleted();
            });

            return(seq);
        }
Exemplo n.º 3
0
        private Sequence FeverColorfulTextTewwn()
        {
            var seq = DOTween.Sequence();

            var tmproAnimator = new DOTweenTMPAnimator(_targetText);

            for (int i = 0; i < tmproAnimator.textInfo.characterCount; i++)
            {
                Vector3 currCharOffset = tmproAnimator.GetCharOffset(i);

                var charSeq = DOTween.Sequence();

                charSeq.Append(tmproAnimator.DOColorChar(i, Color.red, 0.1f));
                charSeq.Append(tmproAnimator.DOColorChar(i, Color.yellow, 0.1f));
                charSeq.Append(tmproAnimator.DOColorChar(i, Color.green, 0.1f));
                charSeq.Append(tmproAnimator.DOColorChar(i, Color.blue, 0.1f));
                charSeq.Append(tmproAnimator.DOColorChar(i, Color.magenta, 0.1f));

                charSeq.SetRelative().SetLoops(100);

                seq.Join(charSeq.SetDelay(i * 0.1f));
            }

            return(seq);
        }
Exemplo n.º 4
0
        private Sequence FeverBonusScoreTextTween()
        {
            var seq = DOTween.Sequence();

            seq.Append(_targetText.DOFade(0, 0));

            var tmproAnimator = new DOTweenTMPAnimator(_targetText);

            for (int i = 0; i < tmproAnimator.textInfo.characterCount; i++)
            {
                Vector3 currCharOffset = tmproAnimator.GetCharOffset(i);

                var charSeq = DOTween.Sequence();

                charSeq.Append(tmproAnimator.DOFadeChar(i, 1, 0.45f));
                charSeq.Join(tmproAnimator.DOOffsetChar(i, currCharOffset + new Vector3(0, 30f, 0), 0.25f).SetEase(Ease.OutFlash, 2));

                seq.Join(charSeq.SetDelay(i * 0.1f));
            }

            seq.OnComplete(() =>
            {
                Debug.Log("OnComplete");
            });

            return(seq);
        }
Exemplo n.º 5
0
    private void AnimateLoadingText()
    {
        DOTweenTMPAnimator animator = new DOTweenTMPAnimator(label);

        for (int i = 0; i < animator.textInfo.characterCount; ++i)
        {
            Vector3 currCharOffset = animator.GetCharOffset(i);
            animator.DOOffsetChar(i, currCharOffset + new Vector3(0, 20f, 0), 0.5f).SetDelay(0.1f * i).SetEase(Ease.InOutQuad).SetLoops(999, LoopType.Yoyo);
        }
    }
Exemplo n.º 6
0
        //[SerializeField] TextMeshProUGUI pressKeyText = null;
        private void GameOver()
        {
            // Observable.EveryUpdate()
            //     .Where(_ => Input.GetButtonDown("Jump"))
            //     .Subscribe(_ =>
            //     {
            //         //SceneManager.LoadSceneAsync("Title");
            //         naichilab.RankingLoader.Instance.SendScoreAndShowRanking(score);
            //     }).AddTo(this);

            StartCoroutine(PlayMissBGM());

            gameoverText.gameObject.SetActive(true);
            gameoverText.DOFade(0, 0);

            Sequence gameoverSeq = DOTween.Sequence();

            DOTweenTMPAnimator gameoverAnimator = new DOTweenTMPAnimator(gameoverText);

            for (int i = 0; i < gameoverAnimator.textInfo.characterCount; i++)
            {
                Vector3 currCharOffset = gameoverAnimator.GetCharOffset(i);

                gameoverSeq.Join(
                    DOTween.Sequence()
                    .Append(gameoverAnimator.DOOffsetChar(i, currCharOffset + new Vector3(0, -60, 0), 0.8f).SetEase(Ease.OutFlash))
                    .Join(gameoverAnimator.DOFadeChar(i, 1, 0.6f))
                    .Join(gameoverAnimator.DOScaleChar(i, 1, 0.6f).SetEase(Ease.OutBack))
                    .SetDelay(0.07f * i)
                    );
            }

            gameoverSeq.OnComplete(() =>
            {
                Naichilab.RankingLoader.Instance.SendScoreAndShowRanking(score);
            });

            // pressKeyText.gameObject.SetActive(true);
            // pressKeyText.DOFade(0, 0);

            // pressKeyText.DOFade(1f, 2.0f)
            // .SetLoops(-1, LoopType.Yoyo)
            // .SetEase(Ease.OutQuad);
        }
Exemplo n.º 7
0
        private async UniTask TweenClearTextAsync(CancellationToken token)
        {
            var tasks         = new List <UniTask>();
            var textAnimation = new DOTweenTMPAnimator(clearText);
            var offset        = Vector3.up * 40.0f;
            var charCount     = textAnimation.textInfo.characterCount;

            for (int i = 0; i < charCount; i++)
            {
                tasks.Add(DOTween.Sequence()
                          .Append(textAnimation
                                  .DOOffsetChar(i, textAnimation.GetCharOffset(i) + offset, Const.CLEAR_TEXT_ANIMATION_TIME)
                                  .SetEase(Ease.OutFlash, 2))
                          .Join(textAnimation
                                .DOFadeChar(i, 1, Const.CLEAR_TEXT_ANIMATION_TIME))
                          .SetDelay(i * 0.04f)
                          .WithCancellation(token));
            }

            _seController.PlaySe(SeType.Clear);

            await UniTask.WhenAll(tasks);

            var highlightColor = new Color(1f, 1f, 0.8f);

            for (int i = 0; i < charCount; i++)
            {
                var interval = i * 0.05f;
                DOTween.Sequence()
                .AppendInterval(0.5f)
                .Append(textAnimation
                        .DOColorChar(i, highlightColor, 0.15f)
                        .SetLoops(2, LoopType.Yoyo)
                        .SetDelay(interval))
                .AppendInterval(3.0f - interval)
                .SetLoops(-1)
                .DisableKill(this);
            }

            await UniTask.Delay(TimeSpan.FromSeconds(0.25f), cancellationToken : token);

            _seController.PlaySe(SeType.Flash);
        }
Exemplo n.º 8
0
        public void StartTextAnimation(string info, Color textColor)
        {
            tmpro.text  = info;
            tmpro.color = textColor;
            tmpro.DOFade(0, 0);
            DOTweenTMPAnimator tmpAnimator = new DOTweenTMPAnimator(tmpro);

            for (int i = 0; i < tmpAnimator.textInfo.characterCount; i++)
            {
                tmpAnimator.DOScaleChar(i, 0.45f, 0);
                Vector3 currCharOffset = tmpAnimator.GetCharOffset(i);
                DOTween.Sequence()
                .Append(tmpAnimator.DOOffsetChar(i, currCharOffset + new Vector3(0, 0.8f, 0), 0.15f).SetEase(Ease.OutFlash, 2))
                //.Append(tmpAnimator.DOOffsetChar(i, currCharOffset + new Vector3(0, -0.4f, 0), 0.25f).SetEase(Ease.OutBounce))
                .Join(tmpAnimator.DOFadeChar(i, 1, 0.05f))
                .Join(tmpAnimator.DOScaleChar(i, 1, 0.4f).SetEase(Ease.OutBack))
                .SetDelay(0.07f * i)
                .OnComplete(() => { StartCoroutine(DestroyObject(tmpAnimator.textInfo.characterCount * 0.07f + 0.7f)); });
            }
        }
Exemplo n.º 9
0
        private async void Start()
        {
            _slider.DOValue(1, 3).SetEase(Ease.InOutSine)
            .OnComplete(() => _signalBus.Fire(new ScreenSignal(ScreenEnum.Top)));

            var textAnimator = new DOTweenTMPAnimator(_text);

            for (var count = 0; count < 2; count++)
            {
                for (var i = 0; i < textAnimator.textInfo.characterCount; i++)
                {
                    var currCharOffset = textAnimator.GetCharOffset(i);
                    textAnimator.DOOffsetChar(i, currCharOffset + new Vector3(0, 30, 0), 0.7f)
                    .SetEase(Ease.InOutFlash, 2)
                    .SetDelay(i * 0.2f);
                }

                await UniTask.Delay(TimeSpan.FromSeconds(2.5f));
            }
        }
    // Start is called before the first frame update
    void Start()
    {
        var target = GetComponent <TextMeshProUGUI>();
        DOTweenTMPAnimator animator = new DOTweenTMPAnimator(target);
        Sequence           sequence = DOTween.Sequence();

        for (int i = 0; i < animator.textInfo.characterCount; ++i)
        {
            if (!animator.textInfo.characterInfo[i].isVisible)
            {
                continue;
            }
            Vector3 currCharOffset = animator.GetCharOffset(i);
            sequence.Append(animator.DOOffsetChar(i, currCharOffset + new Vector3(0, 5, 0), animationTime));
            sequence.Join(animator.DOColorChar(i, Color.yellow, animationTime));
            sequence.Append(animator.DOOffsetChar(i, currCharOffset + new Vector3(0, -5, 0), animationTime));
            sequence.Join(animator.DOColorChar(i, Color.white, animationTime));
        }

        sequence.SetLoops(-1, LoopType.Yoyo);
    }