Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何通过脚本为粗体按钮文本加下划线(Unity3d)_C#_Unity3d_Button_Uibutton_Underline - Fatal编程技术网

C# 如何通过脚本为粗体按钮文本加下划线(Unity3d)

C# 如何通过脚本为粗体按钮文本加下划线(Unity3d),c#,unity3d,button,uibutton,underline,C#,Unity3d,Button,Uibutton,Underline,如何在Unity3D中通过脚本为UI按钮文本加下划线和粗体?我正在根据游戏中所需的数字动态创建按钮。您可以使用富文本标记: <u>underline text</u> <b>bold text</b> <u><b>underline bold text</b></u> 给文本加下划线 粗体文本 粗体下划线 团结一致: textfield.text = "<u><b>he

如何在Unity3D中通过脚本为UI按钮文本加下划线和粗体?我正在根据游戏中所需的数字动态创建按钮。

您可以使用富文本标记:

<u>underline text</u>

<b>bold text</b>

<u><b>underline bold text</b></u>
给文本加下划线
粗体文本
粗体下划线
团结一致:

textfield.text = "<u><b>hello world</b></u>";
textfield.text=“你好世界”;

您可以使用富文本标记:

<u>underline text</u>

<b>bold text</b>

<u><b>underline bold text</b></u>
给文本加下划线
粗体文本
粗体下划线
团结一致:

textfield.text = "<u><b>hello world</b></u>";
textfield.text=“你好世界”;

对不起,我应该提到,我正在通过数组访问按钮:
按钮[I].getComponentChildren().color=color.red。所以我猜我不能以这种方式使用富文本标记?你可以:
buttons[I].getComponentChildren().text=“bold text”对不起,我应该提到,我是通过数组访问按钮的:
按钮[I].getComponentChildren().color=color.red。所以我猜我不能以这种方式使用富文本标记?你可以:
buttons[I].getComponentChildren().text=“bold text”