Beispiel #1
0
    public IEnumerator TypeAnim()
    {
        isTyping = true;
        Vector3 wordPos = Vector3.left * bubbleWidth * 0.5f + Vector3.up * (bubbleHeight - speechData.padding.y);

        while (firstLineQueue.Count > 0)
        {
            WordData word    = firstLineQueue.Dequeue();
            TextMesh newWord = Instantiate(wordPrefab, parts[12]);
            word.Popup(newWord, wordPos, speechData.fontSize);
            StartCoroutine(FadeText(newWord, word.wordColor));

            if (word.isShaking)
            {
                ImpulseManager.instance.GenerageImpuse(ImpulseManager.ImpulseSelect.Speech);
            }
            if (word.isWaving)
            {
                StartCoroutine(WaveText(newWord, word.wavePower, word.waveDuration, word.waveCount));
            }

            wordPos += Vector3.right * speechData.wordSize.x;

            yield return(new WaitForSeconds(word.delay));
        }

        if (hasSecondLine)
        {
            wordPos = Vector3.left * bubbleWidth * 0.5f + Vector3.up * (speechData.padding.w + speechData.wordSize.y);
            while (secondLineQueue.Count > 0)
            {
                WordData word    = secondLineQueue.Dequeue();
                TextMesh newWord = Instantiate(wordPrefab, parts[12]);
                word.Popup(newWord, wordPos, speechData.fontSize);
                StartCoroutine(FadeText(newWord, word.wordColor));

                if (word.isShaking)
                {
                    Debug.Log("카메라 흔들");
                }
                if (word.isWaving)
                {
                    StartCoroutine(WaveText(newWord, word.wavePower, word.waveDuration, word.waveCount));
                }

                wordPos += Vector3.right * speechData.wordSize.x;

                yield return(new WaitForSeconds(word.delay));
            }
        }
        yield return(new WaitForSeconds(speechData.showDuration));

        isTyping = false;
        StartCoroutine(DisappearAnim());
    }