the system you decide on kinda depends on how far you will be going with menus and sub-menus and info you are collecting. you are describing a simple situation but i assume you will need to keep track of a whole lot more info before your game is done! there are many different systems through coding that can save you a ton of time if you are dealing with a bunch of different buttons. in your situation I would definatly get fimiliar with arrays to hold your info if you are not allready doing that. sorry for using the old GUI display but this should at least show a coding example to show how loops and arrays work to save user input in different menus! this uses an array to represent four menus. inside each of the four, there is another array to represent values. then it saves a corresponding index number for what the user has selected. I hope this gets you thinking in the right direction!!!
int i,i2;
int[] s;
string[][] buts;
void Start () {
buts = new string[4][];
buts [0] = new string[]{"red","blue","black","green","white"};
buts [1] = new string[]{"2gb","4gb","8gb","100gb"};
buts [2] = new string[]{"chicken","oink","turtle","sasquach"};
buts [3] = new string[]{"bigfoot is real","i am a nerd","hello world"};
s = new int[buts.Length];}
void OnGUI(){
i = buts.Length;
while(i>0){i--;
i2=buts*.Length;*
if(GUI.Button(new Rect(i150,i240,145,35),buts_[i2])){s*=i2;}}}
i=buts.Length;
while(i>0){i–;_
GUI.Label(new Rect(300,300+(i40),200,40),buts_[s*]);
}}*
or if you wanted buttons to get to the menus you could do something like this:_
* int i,i2;*
* int[] s;*
string[][] buts;
* int menu;*
void Start () {
* menu = -1;*
* buts = new string[4][];*
* buts [0] = new string[]{“colors”,“red”,“blue”,“black”,“green”,“white”};*
* buts [1] = new string[]{“ram”,“2gb”,“4gb”,“8gb”,“100gb”};*
* buts [2] = new string[]{“i am a”,“chicken”,“oink”,“turtle”,“sasquach”};*
* buts [3] = new string[]{“personality”,“bigfoot is real”,“i am a nerd”,};*
* s = new int[buts.Length];}*
* void OnGUI(){*
* if(menu==-1){i = buts.Length;*
* while(i>0){i–;*
_ if(GUI.Button(new Rect(250,i40,145,35),buts[0])){menu=i++;}}}
else{*_
* i=buts[menu].Length;*
_ if(GUI.Button(new Rect(150,i40,145,35),“BACK TO MAIN MENU”)){menu=-1;i=0;}
while(i>1){i–;
if(GUI.Button(new Rect(150,i40,145,35),buts[menu])){s[menu]=i;}}}
* i=buts.Length;
while(i>0){i–;_
GUI.Label(new Rect(300,300+(i40),200,40),buts_[s*]);
}}*
Sorry for the ugly display but this is how arrays and index numbers could work!!!_