/// <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;
         }
     }
 }
Example #2
0
        private IEnumerator Clean()
        {
            control.text = UnityUITypewriterEffect.StripRPGMakerCodes(control.text);
            yield return(null);

            control.text = UnityUITypewriterEffect.StripRPGMakerCodes(control.text);
        }
 public void OnEnable()
 {
     if (control == null)
     {
         return;
     }
     control.text = UnityUITypewriterEffect.StripRPGMakerCodes(control.text);
 }
		public void Awake() {
			if (dialogueUI == null) {
				dialogueUI = Tools.GetComponentAnywhere<UnityUIDialogueUI>(gameObject);
			}
			if (typewriterEffect == null) {
				typewriterEffect = GetComponentInChildren<UnityUITypewriterEffect>();
			}
		}
 public virtual void Awake()
 {
     if (dialogueUI == null)
     {
         dialogueUI = Tools.GetComponentAnywhere <UnityUIDialogueUI>(gameObject);
     }
     if (typewriterEffect == null)
     {
         typewriterEffect = GetComponentInChildren <UnityUITypewriterEffect>();
     }
 }
 public virtual void Awake()
 {
     if (dialogueUI == null)
     {
         dialogueUI = Tools.GetComponentAnywhere <UnityUIDialogueUI>(gameObject);
     }
     if (typewriterEffect == null)
     {
         typewriterEffect = GetComponentInChildren <UnityUITypewriterEffect>();
     }
     continueButton = GetComponent <UnityEngine.UI.Button>();
     Tools.DeprecationWarning(this);
 }
Example #7
0
        private void RemoveIfDuplicate()
        {
            var effects = GetComponents <UnityUITypewriterEffect>();

            if (effects.Length > 1)
            {
                UnityUITypewriterEffect keep = effects[0];
                for (int i = 1; i < effects.Length; i++)
                {
                    if (effects[i].GetInstanceID() < keep.GetInstanceID())
                    {
                        keep = effects[i];
                    }
                }
                for (int i = 0; i < effects.Length; i++)
                {
                    if (effects[i] != keep)
                    {
                        Destroy(effects[i]);
                    }
                }
            }
        }