//5.2.0 public void ModifyMesh(Mesh verts) { if (enabled && gameObject.activeInHierarchy) { var vtArray = verts.vertices; var glyph = new GlyphPlain(); for (int c = 0; c < Text.text.Length; c++) { glyph.Load(ref vtArray, c * 4); float xDistance = AbsolutePosition + glyph.Rect.center.x; float tf = AbsoluteToRelative(xDistance); Vector3 pos = this.GetInterpolatedSourcePosition(tf); Vector3 tan = this.GetTangent(tf); var off = pos - Rect.localPosition - glyph.Center; // position offset to spline glyph.Transpose(new Vector3(0, glyph.Center.y, 0)); // shift to match baseline // Rotate, then offset to real position glyph.Rotate(Quaternion.AngleAxis(Mathf.Atan2(tan.x, -tan.y) * Mathf.Rad2Deg - 90, Vector3.forward)); glyph.Transpose(off); glyph.Save(ref vtArray, c * 4); } verts.vertices = vtArray; } }