unity programmatically change button text code example
Example 1: unity how to change text in script
Text myText = GameObject.Find("Canvas/Text").GetComponent<Text>();
myText.text = "Your text changed!";
Example 2: unity how to change the text on a button
GameObject.Find("Button Name").GetComponentInChildren<Text>().text = "Button Text";