Browse Source

Fixed Say text appears for single frame when using Say command #575

master
Christopher 8 years ago
parent
commit
1e067a01fa
  1. 13
      Assets/Fungus/Scripts/Components/Writer.cs

13
Assets/Fungus/Scripts/Components/Writer.cs

@ -130,15 +130,20 @@ namespace Fungus
writerListeners.Add(writerListener);
}
}
CacheHiddenColorStrings();
}
protected virtual void Start()
protected virtual void CacheHiddenColorStrings()
{
// Cache the hidden color string
Color32 c = hiddenTextColor;
hiddenColorOpen = String.Format("<color=#{0:X2}{1:X2}{2:X2}{3:X2}>", c.r, c.g, c.b, c.a);
hiddenColorClose = "</color>";
}
protected virtual void Start()
{
if (forceRichText)
{
if (textUI != null)
@ -587,6 +592,12 @@ namespace Fungus
if (SupportsRichText() &&
rightString.Length > 0)
{
// Ensure the hidden color strings are populated
if (hiddenColorOpen.Length == 0)
{
CacheHiddenColorStrings();
}
outputString.Append(hiddenColorOpen);
outputString.Append(rightString);
outputString.Append(hiddenColorClose);

Loading…
Cancel
Save