void OnRectTransformDimensionsChangeInternal() { if (m_rectTransform) { if (m_richText) { var size = m_rectTransform.rect.size; m_richText.SetTextWidth(size.x); m_richText.Format(); } } }
public static void SetRichText(RichText richText, string richSyntax) { if (richText != null) { var ret = RichTextManager.ParseRichSyntax(richSyntax, richText); if (ret) { richText.Format(); } else { richText.ClearRichElements(); } } }
void OnDimensionChangeInternal() { if (m_richText) { if (m_widget) { if (m_richText.GetTextWidth() != m_widget.width) { m_richText.SetTextWidth(m_widget.width); m_richText.Format(); if (m_widget) { NGUIRichTextUtil.AdjustDepth(m_richText.gameObject, m_widget.depth); } } } } }