static void GetChildUVInfo(ModelElement child, ShareText ori, List <UIVertex> vertices, Vector3 position, Quaternion quate, Vector3 scale) { var pos = child.data.localPosition; Vector3 p = quate * pos; Vector3 o = Vector3.zero; o.x = p.x * scale.x; o.y = p.y * scale.y; o.z = p.z * scale.z; o += position; Vector3 s = child.data.localScale; Quaternion q = quate * child.data.localRotation; s.x *= scale.x; s.y *= scale.y; if (child.activeSelf) { var stc = child.GetComponent <ShareTextChildElement>(); if (stc != null) { if (stc.text != null & stc.text != "") { if (stc.IsChanged) { TextGenerationSettings settings = new TextGenerationSettings(); settings.font = ori.font; settings.pivot = child.data.pivot; settings.generationExtents = child.data.sizeDelta; settings.horizontalOverflow = stc.data.horizontalOverflow; settings.verticalOverflow = stc.data.verticalOverflow; settings.resizeTextMaxSize = stc.data.fontSize; settings.resizeTextMinSize = stc.data.fontSize; settings.generateOutOfBounds = stc.data.generateOutOfBounds; settings.resizeTextForBestFit = false; settings.textAnchor = stc.data.textAnchor; settings.fontStyle = stc.data.fontStyle; settings.scaleFactor = 1; settings.richText = stc.data.richText; settings.lineSpacing = stc.data.lineSpacing; settings.fontSize = stc.data.fontSize; settings.color = stc.data.color; settings.alignByGeometry = stc.data.alignByGeometry; stc.buffer = ShareText.CreateEmojiMesh(ori, stc.emojiString, ref settings); stc.IsChanged = false; } } var buf = stc.buffer; if (buf != null) { UIVertex[] vert = new UIVertex[buf.Length]; Array.Copy(buf, vert, buf.Length); for (int i = 0; i < vert.Length; i++) { vert[i].position.x *= s.x; vert[i].position.y *= s.y; vert[i].position = q * vert[i].position + o; } vertices.AddRange(vert); } } for (int i = 0; i < child.child.Count; i++) { GetChildUVInfo(child.child[i], ori, vertices, o, q, s); } } }