for each button count i want there to be a matched amount of the GUI button so if buttoncount = 5 i want there to be 5 copys of the GUI button each number it goes up i want the location of the button to change by var h and var w
4 buttons width wise and 7 buttons height wise
so this is my 1st script
which contain slots
#pragma strict
var w = 0; //change the location width wise
var h = 0; // change the location height wise
var s = 50;//size of the buttons
var buttoncount = 1;//amount of buttons
function OnGUI()
{
GUI.Button(Rect(w, h, s, s), buttoncount.ToString());
}
this is my 2nd script which determine how buttons will be created
#pragma strict
var slot : buttons;
var pick : boolean = false;
function Start ()
{
slot = gameObject.GetComponent("buttons");
}
function Update ()
{
if(pick)
{
slot.buttoncount = 5;
}
}
↧