Modify the content of the text in a GUi bottom
Is it ok? If can ,please tell me how to use scripts to modify it. Thanks!
Comment
Best Answer
Answer by JedBeryll · May 14, 2016 at 02:12 PM
By GUI bottom do you mean Button? Because the button text is just another Text component so it's totally ok. Just find the text component and change it. public GameObject button;
void Start()
{
button.transform.Find("Text").GetComponent<Text>().text = "whatever you want";
}
Note that if you want to use UI you need to use its namespace: using UnityEngine.UI;