Hello,
I want to draw 5 buttons to screen. How to do this?
Hello,
I want to draw 5 buttons to screen. How to do this?
function OnGUI(){
if( GUILayout.Button("hello") )
//Stuff
if( GUILayout.Button("hello") )
//Stuff
if( GUILayout.Button("hello") )
//Stuff
if( GUILayout.Button("hello") )
//Stuff
if( GUILayout.Button("hello") )
//Stuff
}
or you can just use the GUIButton 5 times.
if (GUI.Button(Rect(10,10,50,50),btnTexture)) Debug.Log("Clicked the button with an image"); if (GUI.Button(Rect(10,70,50,30),"Click")) Debug.Log("Clicked the button with text");
Ofcourse i forgot to add on my first post… so they need to be array. And Javascript.
In an array how?
Why do you need them in an array?
If it is just like push button 1 arr[0] = false, etc just put the part of the array in the if argument.
Why don’t you check out the solution I linked and convert it to UnityScript?
Because im bad with C#