42 {
43 if (!IsActive())
44 {
45 return;
46 }
48 Text component = GetComponent<Text>();
49 List<string> list = new List<string>();
50 for (int i = 0; i < component.cachedTextGenerator.lineCount; i++)
51 {
52 int startCharIdx = component.cachedTextGenerator.lines[i].startCharIdx;
53 int num = ((i < component.cachedTextGenerator.lineCount - 1) ? component.cachedTextGenerator.lines[i + 1].startCharIdx : component.text.Length);
54 list.Add(component.text.Substring(startCharIdx, num - startCharIdx));
55 }
56 float num2 =
offset * (float)component.fontSize / 100f;
57 float num3 = 0f;
58 IEnumerator enumerator = null;
59 Match match = null;
60 if (component.alignment == TextAnchor.LowerLeft || component.alignment == TextAnchor.MiddleLeft || component.alignment == TextAnchor.UpperLeft)
61 {
62 num3 = 0f;
63 }
64 else if (component.alignment == TextAnchor.LowerCenter || component.alignment == TextAnchor.MiddleCenter || component.alignment == TextAnchor.UpperCenter)
65 {
66 num3 = 0.5f;
67 }
68 else if (component.alignment == TextAnchor.LowerRight || component.alignment == TextAnchor.MiddleRight || component.alignment == TextAnchor.UpperRight)
69 {
70 num3 = 1f;
71 }
72 bool flag = true;
73 int num4 = 0;
74 for (int j = 0; j < list.Count; j++)
75 {
76 if (!flag)
77 {
78 break;
79 }
80 string text = list[j];
81 int lengthWithoutTags = text.Length;
82 if (lengthWithoutTags > component.cachedTextGenerator.characterCountVisible - num4)
83 {
84 lengthWithoutTags = component.cachedTextGenerator.characterCountVisible - num4;
85 text = text.Substring(0, lengthWithoutTags) + " ";
86 lengthWithoutTags++;
87 }
88 if (component.supportRichText)
89 {
91 match = null;
92 if (enumerator.MoveNext())
93 {
94 match = (Match)enumerator.Current;
95 }
96 }
97 bool flag2 = list[j].Length > 0 && (list[j][list[j].Length - 1] == ' ' || list[j][list[j].Length - 1] == '\n');
98 float num5 = (float)(-(lengthWithoutTags - 1 - (flag2 ? 1 : 0))) * num2 * num3;
99 float num6 = 0f;
100 for (int k = 0; k < text.Length; k++)
101 {
102 if (!flag)
103 {
104 break;
105 }
106 if (component.supportRichText && match != null && match.Index == k)
107 {
108 k += match.Length - 1;
109 num4 += match.Length - 1;
110 num6 -= 1f;
111 match = null;
112 if (enumerator.MoveNext())
113 {
114 match = (Match)enumerator.Current;
115 }
116 }
117 if (num4 * 6 + 5 >=
m_Verts.Count)
118 {
119 flag = false;
120 break;
121 }
122 for (int l = 0; l < 6; l++)
123 {
124 UIVertex value =
m_Verts[num4 * 6 + l];
125 value.position += Vector3.right * (num2 * num6 + num5);
127 }
128 num4++;
129 num6 += 1f;
130 }
131 }
132 vh.Clear();
133 vh.AddUIVertexTriangleStream(
m_Verts);
134 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
MatchCollection GetRegexMatchedTags(string text, out int lengthWithoutTags)