예제 #1
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);
        }
예제 #2
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();
        }
예제 #3
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);
        }
예제 #4
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);
        }
    }
    // 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);
    }
예제 #6
0
    private TextMeshProUGUI text;   //ゲームクリアと表示するテキスト

    // Start is called before the first frame update
    void Start()
    {
        text = GetComponent <TextMeshProUGUI>();
        DOTweenTMPAnimator Animator = new DOTweenTMPAnimator(text);

        for (int i = 0; i < Animator.textInfo.characterCount; i++)
        {
            DOTween.Sequence()                                    //Seqence = 一回のアニメーションをまとめるもの
            .Append(Animator.DOOffsetChar(i, Vector3.up * 20, 2f) //テキストを少し上下に動かす
                    .SetEase(Ease.InOutFlash, 2))                 //動かす時の動き方の変化 EaseをInOutFlashに設定
            .SetLoops(-1);                                        //-1 無限ループ
        }
    }
    //Start is called before the first frame update
    void Start()
    {
        DOTweenTMPAnimator Animator = new DOTweenTMPAnimator(TitleText);

        for (int i = 0; i < Animator.textInfo.characterCount; i++)                                    //for分で透明度の値を変える(Fade)
        {
            DOTween.Sequence().                                                                       //Seqence = 一回のアニメーションをまとめるもの
            Append(Animator.DOFadeChar(i, 1, 2f))                                                     //テキストの透明度をだんだん上げていく
            .Join(Animator.DOOffsetChar(i, Vector3.up * 20, 1f).SetEase(Ease.InOutFlash, 2))          //文字を個別に少し跳ねさせる
            .AppendInterval(0.4f)
            .Append(Animator.DOColorChar(i, new Color(1f, 0.5f, 1f), 0.2f).SetEase(Ease.OutFlash, 2)) //DoColorCharとEase.OutFlashで光が走る様にする
            .SetDelay(i * 0.1f);
        }
    }
예제 #8
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);
        }
예제 #9
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);
        }
예제 #10
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)); });
            }
        }
예제 #11
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));
            }
        }