I need help! I’m not used to the new Unity UI system, as far as I know you can only add individual scripts to buttons. However, in my situation I want one script to handle the functionality of many buttons attached to an empty game object or something. Heres an image of what I want to try and program currently:
For the current arrow buttons I want the word to change from skin → hair - > eyes as pressed accordingly, how would I go about this with the new system? Make a global integer variable and use that in each button script??
Hey, thanks for the reply but how do I access the buttons via code? I have to increment or decrement depending on the button being pressed up to 3 times. So instead of just changing the text once depending on the button if i hit right from state 1 itll go to state 2 if i hit left from state 2 itll go to state 1. I need a unifying variable between the 2 buttons keeping track of the integer state.
Im more asking related to syntax, I understand the logic, I know how to do this with the old OnGUI() system, i just dont know how to have a global variable between 2 buttons now that they each generally require a separate script… ya know what i mean? or am i just being stupid XD