Skip to content

Commit

Permalink
Fix Issue #38 by clearing TextMeshInfo before printing
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardrowe committed Jul 20, 2020
1 parent f47178a commit 0643c93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Assets/RedBlueGames/TextTyper/TextTyper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ public void TypeText(string text, float printDelay = -1)
this.defaultPrintDelay = printDelay > 0 ? printDelay : PrintDelaySetting;
this.ProcessTags(text);

// Fix Issue-38 by clearing any old textInfo like sprites, so that SubMesh objects don't reshow their contents.
var textInfo = this.TextComponent.textInfo;
textInfo.ClearMeshInfo(false);

this.typeTextCoroutine = this.StartCoroutine(this.TypeTextCharByChar(text));
}

Expand Down Expand Up @@ -282,7 +286,7 @@ private void ProcessTags(string text)
{
printedCharCount++;

TypableCharacter characterToType = new TypableCharacter ();
TypableCharacter characterToType = new TypableCharacter();
if (symbol.IsTag && symbol.IsReplacedWithSprite)
{
characterToType.IsSprite = true;
Expand Down

0 comments on commit 0643c93

Please sign in to comment.