Basically I want to have a list of button objects, then run through the whole list and change their names dynamically.
1 Answer
1public Text buttonTexts; //assign in inspector
public void ChangeButtonNames(string toName) {
foreach (var button in buttonTexts) {
button.text = toName;
}
}
This is pretty basic.
public Text[] buttonTexts; //assign in inspector public void ChangeButtonNames(string toName) { foreach (var button in buttonTexts) { button.text = toName; } }
– ShadyProductions