Hi all. 1st off, thanks to everyone that has helped me out a huge lot over the last few days. You guys really made my 1st steps into coding a lot more bearable than otherwise
Ok, problem time:
function OnGUI()
{
for (var g : GameObject in InventoryGrid)
{
items= g.GetComponent(ItemIdentifier).ItemTexture;
}
GUI.skin = MenuSkin;
if (DisplayCharacter)
{
GUI.BeginGroup
(new Rect(Screen.width0.3,Screen.height0.1,Screen.width0.4,Screen.height0.8));
GUI.Box(Rect(0,0,Screen.width0.4,Screen.height0.8),“”);
for(i=0;i<InventoryGrid.length;i++)
{
GUI.Button(Rect(0+(i*Screen.width*0.05),0,Screen.height*0.05, Screen.height*0.05),items);
}
GUI.EndGroup ();
}
^ So, basically I’m made an array to display the Icons (ItemTexture) found within an Item Script (ItemIdentifier) of Objects from my array (Inventory Grid)
^In the 1st photo, my inventory is empty. In the next one, I’ve added 5 maces. In the third, I added a new item with a blank texture and all the previous 5 textures were cleared. However, when i added another mace, now all the textures are maces again.