i hit a wall! xD again -.-
well i got 2 scripts atm. item.cs and inventory.cs
i want the script to make 4 buttons, then a new line, 4 buttons new line and so forth. how do i do that?
here is what i got this far:
ITEM
public bool isEquipped = false;
public int itemId;
public int buyPrice;
public int sellPrice;
public GameObject itemVisual;
public Texture2D icon;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//shows and hides item when equipped and unequipped
//if (isEquipped == true){
// itemVisual.renderer.enabled = true;
//}
//else itemVisual.renderer.enabled = false;
///////////////////////////////////////////////////
}
public void isEquippedCheck (){
if (isEquipped == true){
itemVisual.renderer.enabled = true;
}
else itemVisual.renderer.enabled = false;
}
}
inventory script here.
public GameObject[] itemSlots = new GameObject[10];
public int i = 0;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI () {
Rect r = new Rect(0,0,35,35); // this is the Rect variable
for (i = 0; i < itemSlots.Length; i++){
if (GUI.Button(r,itemSlots*.GetComponentInChildren<item>().icon)){*
-
}*
-
}*
}
}