1100929 TMP
by 黃國哲 2021-09-29 00:10:11, 回應(0), 人氣(609)
https://www.cg.com.tw/UnityTextMeshPro/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class searchitem : MonoBehaviour
{
public TextMeshProUGUI itemname; //提取名字為 itemname.text
public void getnamebtn()
{
{ GameObject.Find(itemname.text).GetComponent<ItemDisplay>().enabled = true; }
}
public void leavenamebtn()
{
{ GameObject.Find(itemname.text).GetComponent<ItemDisplay>().enabled = false; }
}
}
////////////////////////////////
using TMPro;
public class GameController : MonoBehaviour
{
public TextMeshProUGUI scoreText;
void Start ()
{
scoreText = GetComponent<TextMeshProUGUI>();
}
}
回應