100 {
101 if (!IsActive())
102 {
103 return;
104 }
108 {
109 return;
110 }
112 {
113 Vector2 zero = Vector2.zero;
114 Vector2 zero2 = Vector2.zero;
116 {
117 Rect rect = GetComponent<RectTransform>().rect;
118 zero = new Vector2(rect.xMin, rect.yMax);
119 zero2 = new Vector2(rect.xMax, rect.yMin);
120 }
121 else
122 {
124 zero2 =
m_Verts[m_Verts.Count - 1].position;
125 for (
int i = 0; i <
m_Verts.Count; i++)
126 {
127 if (
m_Verts[i].position.x < zero.x)
128 {
129 zero.x =
m_Verts[i].position.x;
130 }
131 if (
m_Verts[i].position.y > zero.y)
132 {
133 zero.y =
m_Verts[i].position.y;
134 }
135 if (
m_Verts[i].position.x > zero2.x)
136 {
137 zero2.x =
m_Verts[i].position.x;
138 }
139 if (
m_Verts[i].position.y < zero2.y)
140 {
141 zero2.y =
m_Verts[i].position.y;
142 }
143 }
144 }
145 float num = zero.y - zero2.y;
146 float num2 = zero2.x - zero.x;
147 for (int j = 0; j < count; j++)
148 {
150 value.uv1 = new Vector2(1f + (value.position.x - zero.x) / num2, 2f - (zero.y - value.position.y) / num);
152 }
153 }
154 else
155 {
156 for (int k = 0; k < count; k++)
157 {
159 value.uv1 = new Vector2(1 + ((k % 6 != 0 && k % 6 != 5 && k % 6 != 4) ? 1 : 0), 1 + ((k % 6 != 2 && k % 6 != 3 && k % 6 != 4) ? 1 : 0));
161 }
162 }
163 vh.Clear();
164 vh.AddUIVertexTriangleStream(
m_Verts);
165 }