2using System.Collections.Generic;
4using System.Text.RegularExpressions;
6using UnityEngine.EventSystems;
9[RequireComponent(typeof(Text))]
30 private static readonly
string RITCH_TEXT_REPLACE =
"(\\<color=.*\\>|</color>|\\<size=.n\\>|</size>|<b>|</b>|<i>|</i>)";
32 private static readonly
char[]
HYP_FRONT =
",)]}、。)〕〉》」』】〙〗〟’”⦆»ァィゥェォッャュョヮヵヶっぁぃぅぇぉっゃゅょゎ‐゠–〜ー?!!?‼⁇⁈⁉・:;。.".ToCharArray();
34 private static readonly
char[]
HYP_BACK =
"(([{〔〈《「『【〘〖〝‘“⦅«".ToCharArray();
36 private static readonly
char[]
HYP_LATIN =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>=/().,".ToCharArray();
56 _text = GetComponent<Text>();
76 _Text.horizontalOverflow = HorizontalWrapMode.Wrap;
84 this.RebuildLayoutTo<Canvas>();
112 LayoutElement component = GetComponent<LayoutElement>();
113 if ((
bool)component && component.enabled && component.preferredWidth != -1f)
115 return component.preferredWidth;
120 LayoutGroup component2 = base.transform.parent.GetComponent<LayoutGroup>();
121 float num = base.transform.parent.Rect().rect.width;
122 if ((
bool)component2)
124 num = num - (float)component2.padding.left - (
float)component2.padding.right;
135 return textWidth - textWidth2;
140 if (
_text.supportRichText)
144 _Text.text = message;
145 return _Text.preferredWidth;
150 if (
string.IsNullOrEmpty(msg))
154 msg = Regex.Replace(msg,
"\\n",
"〒");
157 _Text.horizontalOverflow = HorizontalWrapMode.Overflow;
158 StringBuilder stringBuilder =
new StringBuilder();
164 if (
text.StartsWith(
"〒"))
167 stringBuilder.AppendLine();
173 stringBuilder.AppendLine();
180 if (num2 > num - (
float)
padding)
182 stringBuilder.Append(Environment.NewLine);
185 stringBuilder.Append(
text);
187 return stringBuilder.ToString();
192 List<string> list =
new List<string>();
193 StringBuilder stringBuilder =
new StringBuilder();
196 for (
int i = 0; i < tmpText.Length; i++)
198 char c2 = tmpText[i];
199 char c3 = ((i < tmpText.Length - 1) ? tmpText[i + 1] : c);
200 char c4 = ((i <= 0) ? c : (c4 = tmpText[i - 1]));
209 stringBuilder.Append(c2);
212 list.Add(stringBuilder.ToString());
213 stringBuilder =
new StringBuilder();
List< Action > actionsNextFrame
List< string > GetWordList(string tmpText)
RectTransform _rectTransform
static bool CHECK_HYP_BACK(char str)
void _SetText(string str, bool useHypenation)
float GetTextWidth(string message)
static bool IsLatin(char s)
static bool CHECK_HYP_FRONT(char str)
string GetFormatedText(string msg)
RectTransform _RectTransform
static readonly string RITCH_TEXT_REPLACE
static readonly char[] HYP_FRONT
void UpdateText(string str)
static readonly char[] HYP_BACK
static readonly char[] HYP_LATIN