コード例 #1
0
        protected virtual void Update()
        {
            if (!IsTyping || IsWaitingOnDelayedText)
            {
                return;
            }

            revealTimer += CharacterRevealSpeed * CharacterRevealSpeedMultiplier;
            if (revealTimer >= CHARACTER_REVEAL_TIME)
            {
                if (CurrentSpeakerTone != null)
                {
                    //audioSource.Stop();
                    //audioSource.Play();
                    audioSource.PlayOneShot(CurrentSpeakerTone);
                }
            }
            while (revealTimer >= CHARACTER_REVEAL_TIME)
            {
                revealTimer -= CHARACTER_REVEAL_TIME;
                RevealedCharacterCount++;
                OnRevealCharacter?.Invoke();
            }

            if (!IsTyping)
            {
                OnAllCharactersRevealed?.Invoke();
            }
        }
コード例 #2
0
 private void RevealAllCharacters()
 {
     RevealedCharacterCount = TextLength;
     OnRevealCharacter?.Invoke();
     OnAllCharactersRevealed?.Invoke();
 }