Hi guys,
Having done some thorough research on the subject, I cannot work out how to create a set of buttons from an array or list. Here is my code that I have written to, upon clicking a GUI button, create a separate set of buttons with names taken from the array. This however has no effect in my game.
private void OnGUI(){
if (some_bool_to_show_gui) {
GUI.Box(new Rect(10,10,100,90), "Do Things");
if (GUI.Button (new Rect (15, 15, 100, 50), "Do Something")) {
DoSomething (); //This Works
}
if (GUI.Button (new Rect (15, 60, 100, 50), "Do Something Else")) {
for (int i = 0; i < SomeArrayofStrings.Length; i++) {
if(GUI.Button (new Rect (15, 60+15*i, 100, 50),SomeArrayofStrings*)) {*
*DoSomethingElse(); *
*} *
}
}
}
}
If anyone can elucidate me in this matter I would really appreciate it!
Cheers,
Popuppirate