I cant seem to get this GUI.Button accept the fact that I am clicking it. I generate the items elsewhere in the code, but note that the slots are just a Vector2 of which is just 0-6 for x and y.
So my code is as follows:
foreach (Inventory_Item item in InventoryItemList) {
if(GUI.Button (new Rect (item.slot.x * 64 + 1, item.slot.y * 64 + 1, item.Texture.width, item.Texture.height), item.Texture, guiStyle))
Debug.Log ("1");
if(GUI.Button (new Rect (item.slot.x * 64 + 1, item.slot.y * 64 + 1, item.Texture.width, item.Texture.height), inventoryTextures.icon_Overlay, guiStyle))
Debug.Log (item.slot);
}
It displays this, but when I click the buttons the console doesn’t say anything. Is there problems with GUI.Button in loops?