Esempio n. 1
0
    public IEnumerator AnimImage()
    {
        Debug.Log("마지막 애니메이션 연출!");
        this.gameObject.SetActive(true);
        FadeOutEvent.Trigger(1);
        yield return(new WaitForSeconds(1f));

        yield return(new WaitForSeconds(_delay));

        float timelapse = 0;

        while (true)
        {
            _imageRect.anchoredPosition = new Vector3(0, Mathf.Lerp(_prevY, _destY, timelapse / _duration), 0);
            timelapse += Time.deltaTime;

            if (_duration < timelapse)
            {
                yield return(new WaitForSeconds(_endDelay));

                this.gameObject.SetActive(false);
                yield break;
            }

            yield return(null);
        }
    }
Esempio n. 2
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;
            }
        }
Esempio n. 3
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;
        }
Esempio n. 4
0
 void OnFadeOut(FadeOutEvent @event) => fade = true;