/// <summary>
 /// Sets a label with formatted text.
 /// </summary>
 /// <param name='label'>
 /// Label to set.
 /// </param>
 /// <param name='formattedText'>
 /// Formatted text.
 /// </param>
 private void SetFormattedText(UnityEngine.UI.Text label, FormattedText formattedText)
 {
     if (label != null)
     {
         if (formattedText != null)
         {
             var text = UITools.GetUIFormattedText(formattedText);
             if (ignorePauseCodes)
             {
                 text = UnityUITypewriterEffect.StripRPGMakerCodes(text);
             }
             label.text = text;
             UITools.SendTextChangeMessage(label);
             if (!haveSavedOriginalColor)
             {
                 originalColor          = label.color;
                 haveSavedOriginalColor = true;
             }
             label.color = (formattedText.emphases.Length > 0) ? formattedText.emphases[0].color : originalColor;
         }
         else
         {
             label.text = string.Empty;
         }
     }
 }
 /// <summary>
 /// Sets the button's text using the specified formatted text.
 /// </summary>
 /// <param name='formattedText'>
 /// The formatted text for the button label.
 /// </param>
 public void SetFormattedText(FormattedText formattedText)
 {
     if (formattedText != null)
     {
         Text = UITools.GetUIFormattedText(formattedText);
         SetColor((formattedText.emphases.Length > 0) ? formattedText.emphases[0].color : defaultColor);
     }
 }
 /// <summary>
 /// Sets the button's text using the specified formatted text.
 /// </summary>
 public virtual void SetFormattedText(FormattedText formattedText)
 {
     if (formattedText == null)
     {
         return;
     }
     text = UITools.GetUIFormattedText(formattedText);
     SetColor((formattedText.emphases.Length > 0) ? formattedText.emphases[0].color : defaultColor);
 }
 protected void SetFormattedText(UITextField textField, string previousText, FormattedText formattedText)
 {
     textField.text = previousText + UITools.GetUIFormattedText(formattedText);
     UITools.SendTextChangeMessage(textField);
     if (!haveSavedOriginalColor)
     {
         originalColor          = textField.color;
         haveSavedOriginalColor = true;
     }
     textField.color = (formattedText.emphases.Length > 0) ? formattedText.emphases[0].color : originalColor;
 }
 /// <summary>
 /// Sets a label with formatted text.
 /// </summary>
 /// <param name='label'>
 /// Label to set.
 /// </param>
 /// <param name='formattedText'>
 /// Formatted text.
 /// </param>
 private void SetFormattedText(UnityEngine.UI.Text label, FormattedText formattedText)
 {
     if (label != null)
     {
         if (formattedText != null)
         {
             label.text = UITools.GetUIFormattedText(formattedText);
             if (!haveSavedOriginalColor)
             {
                 originalColor          = label.color;
                 haveSavedOriginalColor = true;
             }
             label.color = (formattedText.emphases.Length > 0) ? formattedText.emphases[0].color : originalColor;
         }
         else
         {
             label.text = string.Empty;
         }
     }
 }