使用Text(TMP)需要引用命名空间TMPro
组件的名称为TMP_Text
using TMPro
public class UIManager : MonoBehaviour
{
public TMP_Text testMeshPro;
private void Start() {
testMeshPro.text = "This is a test sentence";
}
}
感谢 https://blog.csdn.net/qq_37672864/article/details/104502501