Hi everyone, is there an alternative to Unity’s standard GUI? Unity’s GUI seems very inefficient. Like say I want to a large list of buttons and I want them to do something. I have to list all of those buttons individually and that results in a very inefficient and demanding script.Here is a example of what I mean
` using UnityEngine;
using System.Collections;
public class ButtonInefficiency : MonoBehaviour {
public int Button1,Button2,Button3,Button4,Button5,Button6,Button7,Button8;
void OnGUI(){
if (GUI.Button(new Rect(525, 275, 25, 25), "Button1")){
++Button1;
}
if (GUI.Button(new Rect(525, 300, 25, 25), "Button2")){
++Button2;
}
if (GUI.Button(new Rect(525, 325, 25, 25), "Button3")){
++Button3;
}
if (GUI.Button(new Rect(525, 350, 25, 25), "Button4")){
++Button4;
}
if (GUI.Button(new Rect(525, 375, 25, 25), "Button5")){
++Button5;
}
if (GUI.Button(new Rect(525, 400, 25, 25), "Button6")){
++Button6;
}
if (GUI.Button(new Rect(525, 425, 25, 25), "Button7")){
++Button7;
}
if (GUI.Button(new Rect(525, 450, 25, 25), "Button8")){
++Button8;
}
//etc
}`
If I want to a large list of buttons I have to type the buttons, their positions and function for each button and that to me is inefficient and clunky.