I've written an Inventory system and have come to a point where I want a small submenu to popup in the form of a selection grid, except that the selection grid isn't returning any value, it stays the same value it was initialized to... So stupid.. however, whenever I right click it does return a value, but not on left click...
Here's my code where I use selection grid, I declare my menuChoice int as a global variable.
if(menuActive == 2)
{
menuPos = new Vector2(mouse.x + 13, mouse.y);
menuActive = 1;
}
Debug.Log("Before Selection : " + menuChoice);
menuChoice = GUI.SelectionGrid(new Rect(menuPos.x, menuPos.y, 100, 100), menuChoice, menuItems,1);
Debug.Log(" Selection : " + menuChoice);
↧