- Home /
How do i make Onclick of a button based on its Text?
Hi, The process I need is Like I have a array of buttons and I need to make the same on click function for every button which gets the text of the button which is clicked and parse it to an int and does Scene Management. Here is the short story of the function
Onclick -> array of buttons -> find button which is clicked -> get component children text -> parse as an int -> int = variable -> SceneManager BuildIndex + variable Cheers!
Your answer
![](https://koobas.hobune.stream/wayback/20220612231829im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Creating Buttons from a Button created from an Array 1 Answer
How do I cycle through colors in an array, setting the selected color as the colour for an image? 1 Answer
Click on two buttons one at a time to get an image 0 Answers
Easier way to resize group of buttons to the same size 0 Answers
Change weapons / gameObject / Int with one button / key 1 Answer