4 таких
Assets/Scripts/Inventory.js(214,176): BCE0019: 'Amount' is not a member of 'Object'.
7 таких
Assets/Scripts/Inventory.js(214,216): BCE0019: 'ID' is not a member of 'Object'.
Вот кусок из скрипта:
Синтаксис:
Используется javascript
class ItemInfo
{
var ID : int;
var Icon : Texture2D;
var Amount : int;
}
function OnGUI()
{
if(DisplayInventory)
{
GUI.skin = mySkin;
Time.timeScale = 0;
Screen.lockCursor = false;
GUI.color = Color.white;
GUILayout.Space(10);
if(GUI.Button(Rect(10, 50, 100, 40), "END GAME"))
{
Application.LoadLevel(0);
}
var width = buttonWidth * rowWidth;
var height = Screen.height - 150;
GUI.DrawTexture(Rect(Screen.width/2 - (width/2) - 50, Screen.height/2 - (height/2) - 110, width + 100, height + 220), menuTexture);
GUI.BeginGroup(Rect(Screen.width/2 - (width/2), Screen.height/2 - (height/2) + 35, width, height - 20), "");
if(lootItems.Count > 0)
for(cnt = 0; cnt < lootItems.Count; cnt++)
{
var Row : int = cnt/rowWidth;
if(GUI.Button(Rect(buttonWidth * cnt - (buttonWidth * rowWidth * Row), Row * buttonHeight, buttonWidth, buttonHeight), GUIContent("x" + lootItems[cnt].Amount.ToString(), Icons[lootItems[cnt].ID])))
{
if(lootItems[cnt].ID != 2)
{
if(itemInHand < 1000)
{
AddItem(itemInHand, 1);
}
itemInHand = lootItems[cnt].ID;
RemoveItem(lootItems[cnt].ID);
DisplayInventory = false;
}
else
{
if(flashLight.curBatteryLife > flashLight.maxBatteryLife/5)
{
print("Battery is not depleted");
}
else
{
flashLight.curBatteryLife = flashLight.maxBatteryLife;
RemoveItem(lootItems[cnt].ID);
DisplayInventory = false;
}
}
}
}
GUI.EndGroup();
}
else if(!DisplayInventory && !DisplayPage)
{
Time.timeScale = 1;
Screen.lockCursor = true;
if(itemInHand < 1000)
{
GUI.Label(Rect(20, (Screen.height - buttonWidth) - 20, buttonWidth, buttonHeight), Icons[itemInHand]);
}
}
else
{
Time.timeScale = 0;
GUI.DrawTexture(Rect(Screen.width/2 - 300, Screen.height/2 - 350, 600, 700), page);
}
}
{
var ID : int;
var Icon : Texture2D;
var Amount : int;
}
function OnGUI()
{
if(DisplayInventory)
{
GUI.skin = mySkin;
Time.timeScale = 0;
Screen.lockCursor = false;
GUI.color = Color.white;
GUILayout.Space(10);
if(GUI.Button(Rect(10, 50, 100, 40), "END GAME"))
{
Application.LoadLevel(0);
}
var width = buttonWidth * rowWidth;
var height = Screen.height - 150;
GUI.DrawTexture(Rect(Screen.width/2 - (width/2) - 50, Screen.height/2 - (height/2) - 110, width + 100, height + 220), menuTexture);
GUI.BeginGroup(Rect(Screen.width/2 - (width/2), Screen.height/2 - (height/2) + 35, width, height - 20), "");
if(lootItems.Count > 0)
for(cnt = 0; cnt < lootItems.Count; cnt++)
{
var Row : int = cnt/rowWidth;
if(GUI.Button(Rect(buttonWidth * cnt - (buttonWidth * rowWidth * Row), Row * buttonHeight, buttonWidth, buttonHeight), GUIContent("x" + lootItems[cnt].Amount.ToString(), Icons[lootItems[cnt].ID])))
{
if(lootItems[cnt].ID != 2)
{
if(itemInHand < 1000)
{
AddItem(itemInHand, 1);
}
itemInHand = lootItems[cnt].ID;
RemoveItem(lootItems[cnt].ID);
DisplayInventory = false;
}
else
{
if(flashLight.curBatteryLife > flashLight.maxBatteryLife/5)
{
print("Battery is not depleted");
}
else
{
flashLight.curBatteryLife = flashLight.maxBatteryLife;
RemoveItem(lootItems[cnt].ID);
DisplayInventory = false;
}
}
}
}
GUI.EndGroup();
}
else if(!DisplayInventory && !DisplayPage)
{
Time.timeScale = 1;
Screen.lockCursor = true;
if(itemInHand < 1000)
{
GUI.Label(Rect(20, (Screen.height - buttonWidth) - 20, buttonWidth, buttonHeight), Icons[itemInHand]);
}
}
else
{
Time.timeScale = 0;
GUI.DrawTexture(Rect(Screen.width/2 - 300, Screen.height/2 - 350, 600, 700), page);
}
}
Надёюсь поможете