Ejemplo n.º 1
0
        /// <summary>
        /// Stops the effect.
        /// </summary>
        public override void Stop()
        {
            base.Stop();
            IsPlaying = false;
            GUILabel control = GetComponent <GUILabel>();

            if (control != null)
            {
                control.currentLength = control.text.Length;
                control.ResetClosureTags();
            }
        }
 private float GetChildYMax(GUIControl child)
 {
     if (child is GUILabel)
     {
         GUILabel guiLabel = child as GUILabel;
         if ((guiLabel.autoSize != null) && (guiLabel.autoSize.autoSizeHeight))
         {
             guiLabel.Refresh(new Vector2(rect.width, rect.height));
             guiLabel.UpdateLayout();
         }
     }
     return(child.rect.yMax);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Advances the label one character or rich text code.
 /// </summary>
 /// <param name="control">GUI Label to advance.</param>
 private void AdvanceOneCharacter(GUILabel control)
 {
     if (control.text[control.currentLength] == '<')
     {
         if (string.Compare(control.text, control.currentLength, RichTextBoldOpen, 0, RichTextBoldOpen.Length) == 0)
         {
             control.currentLength += RichTextBoldOpen.Length;
             control.PushClosureTag(RichTextBoldClose);
         }
         else if (string.Compare(control.text, control.currentLength, RichTextBoldClose, 0, RichTextBoldClose.Length) == 0)
         {
             control.currentLength += RichTextBoldClose.Length;
             control.PopClosureTag();
         }
         else if (string.Compare(control.text, control.currentLength, RichTextItalicOpen, 0, RichTextItalicOpen.Length) == 0)
         {
             control.currentLength += RichTextItalicOpen.Length;
             control.PushClosureTag(RichTextItalicClose);
         }
         else if (string.Compare(control.text, control.currentLength, RichTextItalicClose, 0, RichTextItalicClose.Length) == 0)
         {
             control.currentLength += RichTextItalicClose.Length;
             control.PopClosureTag();
         }
         if (string.Compare(control.text, control.currentLength, RichTextColorOpenPrefix, 0, RichTextColorOpenPrefix.Length) == 0)
         {
             control.currentLength += RichTextColorOpenPrefix.Length + 10; // <color=#rrggbbaa>
             control.PushClosureTag(RichTextColorClose);
         }
         else if (string.Compare(control.text, control.currentLength, RichTextColorClose, 0, RichTextColorClose.Length) == 0)
         {
             control.currentLength += RichTextColorClose.Length;
             control.PopClosureTag();
         }
     }
     else
     {
         control.currentLength++;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Advances the label one character or rich text code.
 /// </summary>
 /// <param name="control">GUI Label to advance.</param>
 private void AdvanceOneCharacter(GUILabel control)
 {
     if (control.text [control.currentLength] == '<') {
         if (string.Compare (control.text, control.currentLength, RichTextBoldOpen, 0, RichTextBoldOpen.Length) == 0) {
             control.currentLength += RichTextBoldOpen.Length;
             control.PushClosureTag (RichTextBoldClose);
         } else if (string.Compare (control.text, control.currentLength, RichTextBoldClose, 0, RichTextBoldClose.Length) == 0) {
             control.currentLength += RichTextBoldClose.Length;
             control.PopClosureTag ();
         } else if (string.Compare (control.text, control.currentLength, RichTextItalicOpen, 0, RichTextItalicOpen.Length) == 0) {
             control.currentLength += RichTextItalicOpen.Length;
             control.PushClosureTag (RichTextItalicClose);
         } else if (string.Compare (control.text, control.currentLength, RichTextItalicClose, 0, RichTextItalicClose.Length) == 0) {
             control.currentLength += RichTextItalicClose.Length;
             control.PopClosureTag ();
         }
         if (string.Compare (control.text, control.currentLength, RichTextColorOpenPrefix, 0, RichTextColorOpenPrefix.Length) == 0) {
             control.currentLength += RichTextColorOpenPrefix.Length + 10; // <color=#rrggbbaa>
             control.PushClosureTag (RichTextColorClose);
         } else if (string.Compare (control.text, control.currentLength, RichTextColorClose, 0, RichTextColorClose.Length) == 0) {
             control.currentLength += RichTextColorClose.Length;
             control.PopClosureTag ();
         }
     } else {
         control.currentLength++;
     }
 }