- Home /
Changing the names of a list of Buttons all at once?
Basically I want to have a list of button objects, then run through the whole list and change their names dynamically.
Comment
Best Answer
Answer by ShadyProductions · Oct 18, 2019 at 04:55 PM
public Text[] buttonTexts; //assign in inspector
public void ChangeButtonNames(string toName) {
foreach (var button in buttonTexts) {
button.text = toName;
}
}
This is pretty basic.
Your answer
![](https://koobas.hobune.stream/wayback/20220612213615im_/https://answers.unity.com/themes/thub/images/avi.jpg)