Beispiel #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();
        }
Beispiel #2
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)); });
            }
        }
Beispiel #3
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);
        }