Пример #1
0
        protected override IEnumerator RevealCharacters(TMP_Text textComponent)
        {
            textComponent.ForceMeshUpdate();

            TMP_TextInfo textInfo = textComponent.textInfo;

            int totalVisibleCharacters = textInfo.characterCount;             // Get # of Visible Character in text object
            int visibleCount           = 0;

            textComponent.maxVisibleCharacters = visibleCount;

            yield return(new WaitForSeconds(_delayDuration));

            while (true)
            {
                if (_isTextChanged)
                {
                    totalVisibleCharacters = textInfo.characterCount;                     // Update visible character count.
                    _isTextChanged         = false;
                }

                if (visibleCount > totalVisibleCharacters)
                {
                    yield return(new WaitForSeconds(_duration));

                    FadeInEvent.Trigger(1);

                    NextPage();

                    if (_isPageEnd)
                    {
                        FadeInEvent.Trigger(1);
                        yield return(new WaitForSeconds(1f));

                        IntroEvent.Trigger();
                        yield break;
                    }

                    visibleCount = 0;

                    yield return(new WaitForSeconds(_delayDuration));

                    ChangeImageEvent.Trigger(_currentPage);
                    FadeOutEvent.Trigger(1);
                }

                if (0 < visibleCount && visibleCount < textComponent.text.Length)
                {
                    char ch = textComponent.text[visibleCount - 1];
                    PlaySound(ch);
                }

                textComponent.maxVisibleCharacters = visibleCount;                 // How many characters should TextMeshPro display?

                yield return(new WaitForSeconds(_typingDelay));

                visibleCount += 1;
            }
        }
Пример #2
0
        IEnumerator TeleportPlayer(PlayerController player)
        {
            // 플레이어가 다 움직일때 까지 기다림
            yield return(new WaitWhile(() => player._isMoving));

            // 진입
            FadeInEvent.Trigger(_fadeInTime, _fadeInTween);
            SoundEvent.Trigger(_sound);

            // 진입후
            player.transform.position = _dest.transform.position;
            player.SetDirection(_dir);
            FadeOutEvent.Trigger(_fadeOutTime, _fadeOutTween);

            yield break;
        }
Пример #3
0
 void OnFadeIn(FadeInEvent @event) => fade   = false;