美文网首页
Unity 修改Button的文字

Unity 修改Button的文字

作者: 114105lijia | 来源:发表于2022-03-25 11:46 被阅读0次
using UnityEngine.UI;

public class Animation : MonoBehaviour
{

    public Button startBtn;

    // Start is called before the first frame update
    void Start()
    {
        Text text = startBtn.transform.Find("Text").GetComponent<Text>();
        text.text = "暂停";
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

相关文章

网友评论

      本文标题:Unity 修改Button的文字

      本文链接:https://www.haomeiwen.com/subject/fforjrtx.html