Unity 3d Text(改变3d文本)

时间:2021-03-03 10:36:14

标签: unity3d

如何将 3d 文本更改为浮点数或整数,我知道如何更改 UI 文本,但我不确定如何使用 text mesh pro 更改 3d 文本。 我用来更改 UI 文本的常用代码是这样的

public Text rotationText;
// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
    rotationText.text = roattion.ToString();
}

1 个答案:

答案 0 :(得分:0)

您可以参考 3dtext 并根据需要进行更改。

using TMPro; 

....
    [SerializeField] TMP_Text textToChange;
private int roattion = 12;

void Start()
{
    textToChange.text = "some text: "+roattion.ToString();
}
相关问题