public void SetText(UnityEngine.UI.Text text, string str) { if (!Object.op_Inequality((Object)text, (Object)null)) { return; } text.set_text(str); }
private float GetTextWidth(UnityEngine.UI.Text label, string message) { if (this._label.get_supportRichText()) { message = Regex.Replace(message, Hyphenation.RichTextReplace, string.Empty); } label.set_text(message); return(label.get_preferredWidth()); }
private bool IsLineCountOver(UnityEngine.UI.Text label, int lineCount) { StringBuilder stringBuilder = new StringBuilder(); for (int index = 0; index < lineCount; ++index) { stringBuilder.Append("\n"); } label.set_text(stringBuilder.ToString()); double preferredHeight = (double)label.get_preferredHeight(); Rect rect = this.RectTransform.get_rect(); double height = (double)((Rect) ref rect).get_height(); return(preferredHeight > height); }