diff --git a/Assets/Fungus/Scripts/Components/Writer.cs b/Assets/Fungus/Scripts/Components/Writer.cs index 019ff519..6e2d40d0 100644 --- a/Assets/Fungus/Scripts/Components/Writer.cs +++ b/Assets/Fungus/Scripts/Components/Writer.cs @@ -584,7 +584,16 @@ namespace Fungus } textAdapter.RevealedCharacters++; - + + NotifyGlyph(); + //TODO need to log some info here, it's not a perf spike + + // Punctuation pause + if (IsPunctuation(textAdapter.LastRevealedCharacter)) + { + yield return StartCoroutine(DoWait(currentPunctuationPause)); + } + if (currentWritingSpeed > 0f) { timeAccumulator -= invWritingSpeed; diff --git a/Assets/Fungus/Scripts/Utils/TextAdapter.cs b/Assets/Fungus/Scripts/Utils/TextAdapter.cs index 34f2f188..0e357792 100644 --- a/Assets/Fungus/Scripts/Utils/TextAdapter.cs +++ b/Assets/Fungus/Scripts/Utils/TextAdapter.cs @@ -233,6 +233,20 @@ namespace Fungus } } + public char LastRevealedCharacter + { + get + { +#if UNITY_2018_1_OR_NEWER + if(tmpro != null) + { + return tmpro.textInfo.characterInfo[tmpro.maxVisibleCharacters].character; + } +#endif + return (char)0; + } + } + public int CharactersToReveal { get