//对齐方式
"<align=right>右对齐";
"<align=center>居中</align>";
"<align=left>左对齐</align>";
//文字颜色
"<color=red>红色</color>";
"<alpha=#FF>FF <alpha=#CC>CC <alpha=#AA>AA <alpha=#88>88<alpha=#66>66 <alpha=#44>44 <alpha=#22>22 <alpha=#00>00";
//文字样式
"<b>加粗";
"<i>斜体";
"<u>下划线";
"<s>删除线";
"<size=40>字体大小";
"<lowercase>Alice and Bob watched TV.</lowercase>";//小写
"<uppercase>Alice and Bob watched TV.</uppercase>";//大写
"<smallcaps>Alice and Bob watched TV.</smallcaps>";//小型大写字母
"标记<mark=#ffff00aa>标记</mark>标记";//小型大写字母
"<cspace=2em>字符间隔";
"1.<indent=15%>缩进,可以使用像素,百分比,字体单位</indent>";
"2.<indent=100>缩进,可以使用像素,百分比,字体单位</indent>";
"<line-height=50%>行高 10%\n <line-height=300%>行高 100%\n行高 150%";
//禁用富文本标签
"Use <noparse><b></noparse> for <b>bold</b> text.";
//上标下标
"We have 1m<sup>3</sup> of H<sub>2</sub>O.";
使用超链接
public TMP_Text m_TextMeshPro;
public void OnPointerClick(PointerEventData eventData)
{
if (m_TextMeshPro)
{
int linkIndex = TMP_TextUtilities.FindIntersectingLink(m_TextMeshPro, Input.mousePosition, null);
if (linkIndex != -1)
{
TMP_LinkInfo linkInfo = m_TextMeshPro.textInfo.linkInfo[linkIndex];
print(linkInfo.GetLinkID());
}
}
}