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(); } }
private void RevealAllCharacters() { RevealedCharacterCount = TextLength; OnRevealCharacter?.Invoke(); OnAllCharactersRevealed?.Invoke(); }