unity how to change the text of a ui element with code code example
Example 1: unity change text
textGameObject.GetComponent<UnityEngine.UI.Text>().text = "text";
Example 2: unity how to change the text on a button
GameObject.Find("Button Name").GetComponentInChildren<Text>().text = "Button Text";
Example 3: how to change the size of ui in script unity
_image.rectTransform.sizeDelta = new Vector2(width, height);
Example 4: unity change the source image or image
public Image test;
public Sprite example;
void Start()
{
test.sprite = example;
}