public void FadeIn()//テキストのフェードイン
 {
     for (int i = 0; i < TextAnimator.textInfo.characterCount; i++)
     {
         //テキストを2秒かけてフェードし、その後少しおいてフェードアウトをスタートする
         TextAnimator.DOFadeChar(i, 1, 2f).SetDelay(i * 0.1f).OnComplete(TextFadeOut);
     }
 }
Exemplo n.º 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();
        }
Exemplo n.º 3
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.º 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 outputGameOverText()
    {
        textAnimator = new DOTweenTMPAnimator(gameOverText);
        var sequence = DOTween.Sequence();

        for (int i = 0; i < textAnimator.textInfo.characterCount; i++)
        {
            sequence
            .Append(textAnimator.DOFadeChar(i, 1, 0.1f))
            .Join(textAnimator.DOPunchCharScale(i, 1.5f, 0.1f))
            .Play();
        }
    }
    //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);
        }
    }
Exemplo n.º 7
0
    /// <summary>
    /// modelから通知を受け取り
    /// feverテキストの描画
    /// カット演出
    /// </summary>
    public void SetFeverTextAnimation()
    {
        textAnimator = new DOTweenTMPAnimator(feverTextAnimation);
        var sequence = DOTween.Sequence();

        for (int i = 0; i < textAnimator.textInfo.characterCount; i++)
        {
            sequence
            .Append(textAnimator.DOFadeChar(i, 1, 0.1f))
            .Join(textAnimator.DOPunchCharScale(i, 1.5f, 0.1f))
            .Play()
            .OnComplete(() => {
                DOVirtual.DelayedCall(1.5f, () => feverTextAnimation.text = "");
            });
        }
    }
Exemplo n.º 8
0
    private void ComboAnimation()
    {
        textAnimator = new DOTweenTMPAnimator(comboText);
        var sequence = DOTween.Sequence();

        for (int i = 0; i < textAnimator.textInfo.characterCount; i++)
        {
            sequence
            .Append(textAnimator.DOFadeChar(i, 1, 1.5f))
            .Join(comboImage.DOPunchScale(Vector3.one, 1.5f))
            //.Join(comboImage.DOFade(0f, 1.5f).SetEase(Ease.Flash))
            //(0.1f, 1.2f).SetEase(Ease.InSine).SetLoops(-1, LoopType.Yoyo))
            .Join(textAnimator.DOPunchCharScale(i, 1.5f, 1.5f))
            .Play()
            //.SetDelay(1.8f)
            .OnComplete(() => { Destroy(this.gameObject); });
        }
    }
Exemplo n.º 9
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.º 10
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.º 11
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.º 12
0
    public void Animate()
    {
        //bodyTexts.alpha = 1;
        titleTextAnimator = new DOTweenTMPAnimator(bodyText);


        //ダイアログ表示
        var sequence = DOTween.Sequence()
                       .Append(dialogCanvasGroup.DOFade(1f, 0.2f))
                       .Join(frameRextTransform.DOSizeDelta(new Vector2(frameSizeDelta.x, 2), 1f)) //同時実行
                       .Append(frameRextTransform.DOSizeDelta(new Vector2(frameSizeDelta.x, frameSizeDelta.y), 1f));

        titleButton.alpha = 0;
        sequence
        .Append(borderCanvasGroup.DOFade(1f, 0.2f))
        .Join(stageButton1.DOFade(1f, 0.2f))
        .Append(titleText.DOFade(1f, 0.2f))
        .Play();


        //タイトル表示
        for (int i = 0; i < titleTextAnimator.textInfo.characterCount; i++)
        {
            sequence
            .Append(titleTextAnimator.DOFadeChar(i, 1, 0.1f))
            .Join(titleTextAnimator.DOPunchCharScale(i, 1.5f, 0.1f));
        }



        //新記録

        //ランクの表示

        //閉じるボタンの表示・実行
        sequence.Append(buttonCloseCanvasGroup.DOFade(1.0f, 0.25f))
        .Append(startButton1.DOFade(1f, 0.1f))
        .OnComplete(() => dialogCanvasGroup.blocksRaycasts = true)
        .Play();
    }
Exemplo n.º 13
0
    public void SetClearUI()
    {
        textAnimator = new DOTweenTMPAnimator(gameClearText);
        var sequence = DOTween.Sequence();

        for (int i = 0; i < textAnimator.textInfo.characterCount; i++)
        {
            sequence
            .AppendCallback(() => Observable.Timer(TimeSpan.FromSeconds(4)).Subscribe(_ =>
            {
                gameClearText.text  = "";
                gameClearText.alpha = 0;
                Debug.Log("スコア表示");


                clearDialogAnimation.Animate();
            }).AddTo(this))
            .Append(textAnimator.DOFadeChar(i, 1, 0.1f))
            .Join(textAnimator.DOPunchCharScale(i, 1.5f, 0.1f))
            .Play();
        }
    }
Exemplo n.º 14
0
    private void outputText()
    {
        demoTextAnimator = new DOTweenTMPAnimator(demoText);
        var sequence = DOTween.Sequence();

        for (int i = 0; i < demoTextAnimator.textInfo.characterCount; i++)
        {
            sequence
            .Append(demoTextAnimator.DOFadeChar(i, 1, 0.1f))
            .Join(demoTextAnimator.DOPunchCharScale(i, 1.5f, 0.1f))
            .InsertCallback(0f, () => CreateChara())
            .Play();
        }

        //TODO:createCharaを実行した後に画面外に抜けたら、ゲームオーバーの表示をしたい
        //OnComplete以外の関数呼び出しを調べる必要がある
        sequence

        //dmeoText.textだと表示されない。TMPのリファレンス読む必要がある
        .AppendCallback(() => isDemo = true)
        .OnComplete(() => DemoOutputGameOverText())
        .Play();
    }
    public void Animate()
    {
        titleTextAnimator = new DOTweenTMPAnimator(titleText);

        //ダイアログ表示
        var sequence = DOTween.Sequence()
                       .Append(dialogCanvasGroup.DOFade(1f, 0.2f))
                       .Join(frameRextTransform.DOSizeDelta(new Vector2(frameSizeDelta.x, 2), 1f)) //同時実行
                       .Append(frameRextTransform.DOSizeDelta(new Vector2(frameSizeDelta.x, frameSizeDelta.y), 1f));

        //タイトル表示
        for (int i = 0; i < titleTextAnimator.textInfo.characterCount; i++)
        {
            sequence
            .Append(titleTextAnimator.DOFadeChar(i, 1, 0.1f))
            .Join(titleTextAnimator.DOPunchCharScale(i, 1.5f, 0.1f));
        }

        //スコア表示
        sequence
        .Append(scoreLabelText.DOFade(1f, 0.5f))
        .Append(scoreValueText.DOFade(1f, 3f))
        .Join(scoreValueText.DOCounter(0, score, 3f, false))
        .AppendCallback(() => scoreValueText.transform.localScale = Vector3.one * 1.25f)
        .Append(scoreValueText.transform.DOScale(Vector3.one, 0.5f))
        .AppendInterval(0.5f);

        //新記録

        //ランクの表示

        //閉じるボタンの表示・実行
        sequence.Append(buttonCloseCanvasGroup.DOFade(1.0f, 0.25f))
        .OnComplete(() => dialogCanvasGroup.blocksRaycasts = true)
        .Play();
    }