Hey guys. Why didn’t work element? GUI.Label (windowRect,“Heeey”);
function OnGUI()
{
if(ShowInventory==true){
var texToUse : Texture;
var currentInventoryItem : InventoryItem;
var windowRect : Rect = Rect (60, 60, 300, 300);
//Go through each row
for( var i = 0; i < inventory.length; i ++ )
{
// and each column
for( var k = 0; k < inventory*.length; k ++ )*
{
currentInventoryItem = inventory*[k];*
//if there is an item in the i-th row and the k-th column, draw it
if( inventory*[k] == null )*
{
GUI.DrawTexture( new Rect( offSet.x+k*(iconWidthHeight+spacing), offSet.y+i*(iconWidthHeight+spacing), iconWidthHeight, iconWidthHeight ), emptyTex );
}
else
{
_ GUI.DrawTexture( new Rect( offSet.x+k*(iconWidthHeight+spacing), offSet.y+i*(iconWidthHeight+spacing), iconWidthHeight, iconWidthHeight ), currentInventoryItem.texRepresentation );
}_
* if(currentInventoryItem != null &&*
_ GUI.Button( new Rect( offSet.x+k*(iconWidthHeight+spacing), offSet.y+i*(iconWidthHeight+spacing), iconWidthHeight, iconWidthHeight ), “”, GUIStyle(“label”) ))
{_
* GUI.Label (windowRect,“Heeey”); // Why didn’t work?*
* currentInventoryItem.worldObject.transform.position = transform.position;*
* currentInventoryItem.worldObject.transform.rotation = transform.rotation;*
* currentInventoryItem.worldObject.active = true;*
* if(Input.GetMouseButtonUp(0))*
* { *
* //Equip it*
* //currentInventoryItem.worldObject.transform.parent = transform;*
* } else if(Input.GetMouseButtonUp(1))*
* {*
* //Drop it*
_ inventory*[k] = null;
currentInventoryItem.worldObject.transform.parent = null;*_
* }*
}
}
}
}