Assets/Inventory/Inventory.js(115,10): BCE0018: The name 'HP' does not denote a valid type ('not found').
СКРИПТ ОБРЕЗАЛ
Расчитываю только на вашу помощ
Зарание Спасибо!!!!!
Синтаксис:
Используется javascript
var skin : GUISkin;
var windowRect : Rect = Rect (20, 200, 240, 240);
var windowRect2 : Rect = Rect (20, 200, 240, 240);
//Multi Inventory System!?!?!
var inventory1 = true;
var inventory2 = false;
var inventory3 = false;
//This makes the script a global script so that anyone can acces it
static var statInventory : Inventory;
var banking = false;
var bankinventory : Array;
//This is to check if the mouse is over the item to display the info, it takes the tooltip and compares it
var mouseOver : String;
//This is just a toggle to see if the inventory screen is active or not
var inventorystate = true;
//This is the 8 slot main inventory
var inventory : Array;
//This is the equiped items inventory
static var EquipedItem : Array;
//This is the money array
static var inventorymoney : Array;
public var emptyTex : Texture;
var bagtexture : Texture;
var iconSize = 36;
var spacing = 4;
//This is the object the mouse is carrying
var mouseitem = null;
//This is the item being displayed in the tooltip
private var tooltipitem1 = null;
private var tooltipitem2 = null;
private var tooltipitem3 = null;
private var tooltipx1 = 0.0;
private var tooltipy1 = 0.0;
private var tooltipx2 = 0.0;
private var tooltipy2 = 0.0;
private var tooltipx3 = 0.0;
private var tooltipy3 = 0.0;
//Items!!!Apear!!>!
//Holding Areas
var EmptyGameObject : Transform;
var EmptyGameObjectb : Transform;
var EmptyGameObjectc : Transform;
var EmptyGameObjectd : Transform;
//Item apearances
var Sword : Transform;
var Staff : Transform;
var Spear1 : Transform;
var Wand1 : Transform;
var shirt : Transform;
var LH : Transform;
var MH : Transform;
var WR1 : Transform;
var WR1a : Transform;
var BronzePlateLegs : Transform;
var aaab_B : Transform;
var aaab_D : Transform;
//"Update Locks"
static var UpdateNeeded = true;
static var UpdateNeededB = true;
static var UpdateNeededC = true;
static var UpdateNeededD = true;
//Stat influence
var HP : HP;
var HPMI = 10;
//fin
var stackamount = 1;
private var readytodrop = false;
var mouseheld = true;
var togglefullscreen = "Off";
var totalweight = "";
var mySkin : GUISkin;
class InventoryItem
{
var worldObject : GameObject;
var itemname : String;
var itemtex : Texture;
var itemtype : String;
var equipmenttype : String;
var usable : String;
var itemweight : float;
var droppable : boolean;
var itemmodel : Transform;
var modeltype = 0;
var itemmesh : String;
var itemstacksize : int;
var itemstacklimit : int;
var showStack : boolean;
var bagsize : int;
var showBag : boolean;
var BagItem : Array;
}
function Awake()
{
statInventory = this;
inventory = new Array(72);
EquipedItem = new Array(20);
EquipedItem[0] = null;
inventorymoney = new Array(4);
bankinventory = new Array(12);
}
function OnGUI()
{
GUI.skin = skin;
if(inventorystate)
{
windowRect2 = GUI.Window(88, windowRect2, WindowFunction, "Inventory");
}
// BANK SECTION
if(banking)
{
windowRect = GUI.Window (94, windowRect, WindowFunction2, "Bank");
}
GUI.skin = mySkin;
ix = Input.mousePosition.x;
iy = Input.mousePosition.y;
GUI.matrix = Matrix4x4.TRS (Vector3.zero, Quaternion.identity, Vector3(Screen.width / 1024.0, Screen.height / 768.0, 1));
var transMouse = GUI.matrix.inverse.MultiplyPoint3x4(Vector3(ix, Screen.height - iy, 1));
if (Input.GetKeyDown(KeyCode.Mouse0) || Input.GetKeyDown(KeyCode.Mouse1) || Input.GetKeyDown(KeyCode.Mouse2)) {
mouseheld = false;
}
if (Input.GetKeyUp(KeyCode.Mouse0) || Input.GetKeyUp(KeyCode.Mouse1) || Input.GetKeyUp(KeyCode.Mouse2)) {
mouseheld = true;
}
/*
if (inventorystate)
{
//GUI.Box (Rect (684,100,335,470),"Trade");
//GUI.Box (Rect (5,100,674,470),"Tome");
if(GUI.Button(Rect(30,460,20,20),"1"))
{
inventory1 = true;
inventory2 = false;
inventory3 = false;
}
if(GUI.Button(Rect(45,460,20,20),"2"))
{
inventory1 =false;
inventory2 = true;
inventory3 = false;
}
if(GUI.Button(Rect(60,460,20,20),"3"))
{
inventory1 =false;
inventory2 = false;
inventory3 = true;
}
GUI.Box (Rect (5,100,335,560),GUIContent ("Character", "this box has a tooltip"));
if (GUI.Button(Rect (320,100,20,20),"X")){
inventorystate = false;
}
//item weight:
//need to calculate it all the time cuz if sometheing goes in a bag then its got a diff weigth if the bag has a weight reduction
totalweight = calculateweight();
GUI.Label (Rect(200,430,100,25),"Weight: " + totalweight);
GUI.Button(Rect(245,495,20,20),"C");
var copper = "";
if (inventorymoney[0] != null){
copper = copper + inventorymoney[0].itemstacksize;
GUI.Label(Rect(266,495,60,20),copper);
} else {
GUI.Label(Rect(266,495,60,20),"0");
}
GUI.Button(Rect(173,495,20,20),"S");
var silver = "";
if (inventorymoney[1] != null){
silver = silver + inventorymoney[1].itemstacksize;
GUI.Label(Rect(194,495,60,20),silver);
} else {
GUI.Label(Rect(194,495,60,20),"0");
}
GUI.Button(Rect(101,495,20,20),"G");
var gold = "";
if (inventorymoney[2] != null){
gold = gold + inventorymoney[2].itemstacksize;
GUI.Label(Rect(121,495,60,20),gold);
} else {
GUI.Label(Rect(121,495,60,20),"0");
}
GUI.Button(Rect(29,495,20,20),"P");
var platinum = "";
if (inventorymoney[3] != null){
platinum = platinum + inventorymoney[3].itemstacksize;
GUI.Label(Rect(50,495,60,20),platinum);
} else {
GUI.Label(Rect(50,495,60,20),"0");
}
equipedItemSlot(0,25,160,"Head");
equipedItemSlot(1,25,197,"Neck");
equipedItemSlot(2,25,234,"Shoulders");
equipedItemSlot(3,25,271,"Back");
equipedItemSlot(4,25,308,"Chest");
equipedItemSlot(5,25,345,"Waist");
equipedItemSlot(6,25,382,"Legs");
equipedItemSlot(7,25,419,"Feet");
equipedItemSlot(8,275,160,"Arms");
equipedItemSlot(9,275,197,"Hands");
equipedItemSlot(10,275,234,"Wrist");
equipedItemSlot(11,275,271,"Wrist");
equipedItemSlot(12,275,308,"Finger");
equipedItemSlot(13,275,345,"Finger");
equipedItemSlot(14,275,382,"Ear");
equipedItemSlot(15,275,419,"Ear");
equipedItemSlot(16,99,456,"Primary");
equipedItemSlot(17,136,456,"Secondary");
equipedItemSlot(18,173,456,"Range");
equipedItemSlot(19,210,456,"Ammo");
if(inventory1 == true)
{
inventoryItemSlot(inventory,0,25,520);
inventoryItemSlot(inventory,1,62,520);
inventoryItemSlot(inventory,2,99,520);
inventoryItemSlot(inventory,3,136,520);
inventoryItemSlot(inventory,4,173,520);
inventoryItemSlot(inventory,5,210,520);
inventoryItemSlot(inventory,6,247,520);
inventoryItemSlot(inventory,7,284,520);
inventoryItemSlot(inventory,8,25,560);
inventoryItemSlot(inventory,9,62,560);
inventoryItemSlot(inventory,10,99,560);
inventoryItemSlot(inventory,11,136,560);
inventoryItemSlot(inventory,12,173,560);
inventoryItemSlot(inventory,13,210,560);
inventoryItemSlot(inventory,14,247,560);
inventoryItemSlot(inventory,15,284,560);
inventoryItemSlot(inventory,16,25,600);
inventoryItemSlot(inventory,17,62,600);
inventoryItemSlot(inventory,18,99,600);
inventoryItemSlot(inventory,19,136,600);
inventoryItemSlot(inventory,20,173,600);
inventoryItemSlot(inventory,21,210,600);
inventoryItemSlot(inventory,22,247,600);
inventoryItemSlot(inventory,23,284,600);
}
if(inventory2 == true)
{
inventoryItemSlot(inventory,24,25,520);
inventoryItemSlot(inventory,25,62,520);
inventoryItemSlot(inventory,26,99,520);
inventoryItemSlot(inventory,27,136,520);
inventoryItemSlot(inventory,28,173,520);
inventoryItemSlot(inventory,29,210,520);
inventoryItemSlot(inventory,30,247,520);
inventoryItemSlot(inventory,31,284,520);
inventoryItemSlot(inventory,32,25,560);
inventoryItemSlot(inventory,33,62,560);
inventoryItemSlot(inventory,34,99,560);
inventoryItemSlot(inventory,35,136,560);
inventoryItemSlot(inventory,36,173,560);
inventoryItemSlot(inventory,37,210,560);
inventoryItemSlot(inventory,38,247,560);
inventoryItemSlot(inventory,39,284,560);
inventoryItemSlot(inventory,40,25,600);
inventoryItemSlot(inventory,41,62,600);
inventoryItemSlot(inventory,42,99,600);
inventoryItemSlot(inventory,43,136,600);
inventoryItemSlot(inventory,44,173,600);
inventoryItemSlot(inventory,45,210,600);
inventoryItemSlot(inventory,46,247,600);
inventoryItemSlot(inventory,47,284,600);
}
if(inventory3 == true)
{
inventoryItemSlot(inventory,48,25,520);
inventoryItemSlot(inventory,49,62,520);
inventoryItemSlot(inventory,50,99,520);
inventoryItemSlot(inventory,51,136,520);
inventoryItemSlot(inventory,52,173,520);
inventoryItemSlot(inventory,53,210,520);
inventoryItemSlot(inventory,54,247,520);
inventoryItemSlot(inventory,55,284,520);
inventoryItemSlot(inventory,56,25,560);
inventoryItemSlot(inventory,57,62,560);
inventoryItemSlot(inventory,58,99,560);
inventoryItemSlot(inventory,59,136,560);
inventoryItemSlot(inventory,60,173,560);
inventoryItemSlot(inventory,61,210,560);
inventoryItemSlot(inventory,62,247,560);
inventoryItemSlot(inventory,63,284,560);
inventoryItemSlot(inventory,64,25,600);
inventoryItemSlot(inventory,65,62,600);
inventoryItemSlot(inventory,66,99,600);
inventoryItemSlot(inventory,67,136,600);
inventoryItemSlot(inventory,68,173,600);
inventoryItemSlot(inventory,69,210,600);
inventoryItemSlot(inventory,70,247,600);
inventoryItemSlot(inventory,71,284,600);
}
}
*/
callBag(inventory,0,345,100);
callBag(inventory,1,515,100);
callBag(inventory,2,345,400);
callBag(inventory,3,515,400);
callBag(inventory,4,685,100);
callBag(inventory,5,855,100);
callBag(inventory,6,685,400);
callBag(inventory,7,855,400);
if (tooltipitem1 != null){
GUI.Box(Rect (tooltipx1,tooltipy1,100,100),tooltipitem1.itemname);
}
tooltipitem1 = null;
if (tooltipitem2 != null){
GUI.Box(Rect (tooltipx2,tooltipy2,100,100),tooltipitem2.itemname);
}
tooltipitem2 = null;
if (tooltipitem3 != null){
GUI.Box(Rect (tooltipx3,tooltipy3,100,100),tooltipitem3.itemname);
}
tooltipitem3 = null;
if (mouseheld){
mouseOver = GUI.tooltip;
}
}
var windowRect : Rect = Rect (20, 200, 240, 240);
var windowRect2 : Rect = Rect (20, 200, 240, 240);
//Multi Inventory System!?!?!
var inventory1 = true;
var inventory2 = false;
var inventory3 = false;
//This makes the script a global script so that anyone can acces it
static var statInventory : Inventory;
var banking = false;
var bankinventory : Array;
//This is to check if the mouse is over the item to display the info, it takes the tooltip and compares it
var mouseOver : String;
//This is just a toggle to see if the inventory screen is active or not
var inventorystate = true;
//This is the 8 slot main inventory
var inventory : Array;
//This is the equiped items inventory
static var EquipedItem : Array;
//This is the money array
static var inventorymoney : Array;
public var emptyTex : Texture;
var bagtexture : Texture;
var iconSize = 36;
var spacing = 4;
//This is the object the mouse is carrying
var mouseitem = null;
//This is the item being displayed in the tooltip
private var tooltipitem1 = null;
private var tooltipitem2 = null;
private var tooltipitem3 = null;
private var tooltipx1 = 0.0;
private var tooltipy1 = 0.0;
private var tooltipx2 = 0.0;
private var tooltipy2 = 0.0;
private var tooltipx3 = 0.0;
private var tooltipy3 = 0.0;
//Items!!!Apear!!>!
//Holding Areas
var EmptyGameObject : Transform;
var EmptyGameObjectb : Transform;
var EmptyGameObjectc : Transform;
var EmptyGameObjectd : Transform;
//Item apearances
var Sword : Transform;
var Staff : Transform;
var Spear1 : Transform;
var Wand1 : Transform;
var shirt : Transform;
var LH : Transform;
var MH : Transform;
var WR1 : Transform;
var WR1a : Transform;
var BronzePlateLegs : Transform;
var aaab_B : Transform;
var aaab_D : Transform;
//"Update Locks"
static var UpdateNeeded = true;
static var UpdateNeededB = true;
static var UpdateNeededC = true;
static var UpdateNeededD = true;
//Stat influence
var HP : HP;
var HPMI = 10;
//fin
var stackamount = 1;
private var readytodrop = false;
var mouseheld = true;
var togglefullscreen = "Off";
var totalweight = "";
var mySkin : GUISkin;
class InventoryItem
{
var worldObject : GameObject;
var itemname : String;
var itemtex : Texture;
var itemtype : String;
var equipmenttype : String;
var usable : String;
var itemweight : float;
var droppable : boolean;
var itemmodel : Transform;
var modeltype = 0;
var itemmesh : String;
var itemstacksize : int;
var itemstacklimit : int;
var showStack : boolean;
var bagsize : int;
var showBag : boolean;
var BagItem : Array;
}
function Awake()
{
statInventory = this;
inventory = new Array(72);
EquipedItem = new Array(20);
EquipedItem[0] = null;
inventorymoney = new Array(4);
bankinventory = new Array(12);
}
function OnGUI()
{
GUI.skin = skin;
if(inventorystate)
{
windowRect2 = GUI.Window(88, windowRect2, WindowFunction, "Inventory");
}
// BANK SECTION
if(banking)
{
windowRect = GUI.Window (94, windowRect, WindowFunction2, "Bank");
}
GUI.skin = mySkin;
ix = Input.mousePosition.x;
iy = Input.mousePosition.y;
GUI.matrix = Matrix4x4.TRS (Vector3.zero, Quaternion.identity, Vector3(Screen.width / 1024.0, Screen.height / 768.0, 1));
var transMouse = GUI.matrix.inverse.MultiplyPoint3x4(Vector3(ix, Screen.height - iy, 1));
if (Input.GetKeyDown(KeyCode.Mouse0) || Input.GetKeyDown(KeyCode.Mouse1) || Input.GetKeyDown(KeyCode.Mouse2)) {
mouseheld = false;
}
if (Input.GetKeyUp(KeyCode.Mouse0) || Input.GetKeyUp(KeyCode.Mouse1) || Input.GetKeyUp(KeyCode.Mouse2)) {
mouseheld = true;
}
/*
if (inventorystate)
{
//GUI.Box (Rect (684,100,335,470),"Trade");
//GUI.Box (Rect (5,100,674,470),"Tome");
if(GUI.Button(Rect(30,460,20,20),"1"))
{
inventory1 = true;
inventory2 = false;
inventory3 = false;
}
if(GUI.Button(Rect(45,460,20,20),"2"))
{
inventory1 =false;
inventory2 = true;
inventory3 = false;
}
if(GUI.Button(Rect(60,460,20,20),"3"))
{
inventory1 =false;
inventory2 = false;
inventory3 = true;
}
GUI.Box (Rect (5,100,335,560),GUIContent ("Character", "this box has a tooltip"));
if (GUI.Button(Rect (320,100,20,20),"X")){
inventorystate = false;
}
//item weight:
//need to calculate it all the time cuz if sometheing goes in a bag then its got a diff weigth if the bag has a weight reduction
totalweight = calculateweight();
GUI.Label (Rect(200,430,100,25),"Weight: " + totalweight);
GUI.Button(Rect(245,495,20,20),"C");
var copper = "";
if (inventorymoney[0] != null){
copper = copper + inventorymoney[0].itemstacksize;
GUI.Label(Rect(266,495,60,20),copper);
} else {
GUI.Label(Rect(266,495,60,20),"0");
}
GUI.Button(Rect(173,495,20,20),"S");
var silver = "";
if (inventorymoney[1] != null){
silver = silver + inventorymoney[1].itemstacksize;
GUI.Label(Rect(194,495,60,20),silver);
} else {
GUI.Label(Rect(194,495,60,20),"0");
}
GUI.Button(Rect(101,495,20,20),"G");
var gold = "";
if (inventorymoney[2] != null){
gold = gold + inventorymoney[2].itemstacksize;
GUI.Label(Rect(121,495,60,20),gold);
} else {
GUI.Label(Rect(121,495,60,20),"0");
}
GUI.Button(Rect(29,495,20,20),"P");
var platinum = "";
if (inventorymoney[3] != null){
platinum = platinum + inventorymoney[3].itemstacksize;
GUI.Label(Rect(50,495,60,20),platinum);
} else {
GUI.Label(Rect(50,495,60,20),"0");
}
equipedItemSlot(0,25,160,"Head");
equipedItemSlot(1,25,197,"Neck");
equipedItemSlot(2,25,234,"Shoulders");
equipedItemSlot(3,25,271,"Back");
equipedItemSlot(4,25,308,"Chest");
equipedItemSlot(5,25,345,"Waist");
equipedItemSlot(6,25,382,"Legs");
equipedItemSlot(7,25,419,"Feet");
equipedItemSlot(8,275,160,"Arms");
equipedItemSlot(9,275,197,"Hands");
equipedItemSlot(10,275,234,"Wrist");
equipedItemSlot(11,275,271,"Wrist");
equipedItemSlot(12,275,308,"Finger");
equipedItemSlot(13,275,345,"Finger");
equipedItemSlot(14,275,382,"Ear");
equipedItemSlot(15,275,419,"Ear");
equipedItemSlot(16,99,456,"Primary");
equipedItemSlot(17,136,456,"Secondary");
equipedItemSlot(18,173,456,"Range");
equipedItemSlot(19,210,456,"Ammo");
if(inventory1 == true)
{
inventoryItemSlot(inventory,0,25,520);
inventoryItemSlot(inventory,1,62,520);
inventoryItemSlot(inventory,2,99,520);
inventoryItemSlot(inventory,3,136,520);
inventoryItemSlot(inventory,4,173,520);
inventoryItemSlot(inventory,5,210,520);
inventoryItemSlot(inventory,6,247,520);
inventoryItemSlot(inventory,7,284,520);
inventoryItemSlot(inventory,8,25,560);
inventoryItemSlot(inventory,9,62,560);
inventoryItemSlot(inventory,10,99,560);
inventoryItemSlot(inventory,11,136,560);
inventoryItemSlot(inventory,12,173,560);
inventoryItemSlot(inventory,13,210,560);
inventoryItemSlot(inventory,14,247,560);
inventoryItemSlot(inventory,15,284,560);
inventoryItemSlot(inventory,16,25,600);
inventoryItemSlot(inventory,17,62,600);
inventoryItemSlot(inventory,18,99,600);
inventoryItemSlot(inventory,19,136,600);
inventoryItemSlot(inventory,20,173,600);
inventoryItemSlot(inventory,21,210,600);
inventoryItemSlot(inventory,22,247,600);
inventoryItemSlot(inventory,23,284,600);
}
if(inventory2 == true)
{
inventoryItemSlot(inventory,24,25,520);
inventoryItemSlot(inventory,25,62,520);
inventoryItemSlot(inventory,26,99,520);
inventoryItemSlot(inventory,27,136,520);
inventoryItemSlot(inventory,28,173,520);
inventoryItemSlot(inventory,29,210,520);
inventoryItemSlot(inventory,30,247,520);
inventoryItemSlot(inventory,31,284,520);
inventoryItemSlot(inventory,32,25,560);
inventoryItemSlot(inventory,33,62,560);
inventoryItemSlot(inventory,34,99,560);
inventoryItemSlot(inventory,35,136,560);
inventoryItemSlot(inventory,36,173,560);
inventoryItemSlot(inventory,37,210,560);
inventoryItemSlot(inventory,38,247,560);
inventoryItemSlot(inventory,39,284,560);
inventoryItemSlot(inventory,40,25,600);
inventoryItemSlot(inventory,41,62,600);
inventoryItemSlot(inventory,42,99,600);
inventoryItemSlot(inventory,43,136,600);
inventoryItemSlot(inventory,44,173,600);
inventoryItemSlot(inventory,45,210,600);
inventoryItemSlot(inventory,46,247,600);
inventoryItemSlot(inventory,47,284,600);
}
if(inventory3 == true)
{
inventoryItemSlot(inventory,48,25,520);
inventoryItemSlot(inventory,49,62,520);
inventoryItemSlot(inventory,50,99,520);
inventoryItemSlot(inventory,51,136,520);
inventoryItemSlot(inventory,52,173,520);
inventoryItemSlot(inventory,53,210,520);
inventoryItemSlot(inventory,54,247,520);
inventoryItemSlot(inventory,55,284,520);
inventoryItemSlot(inventory,56,25,560);
inventoryItemSlot(inventory,57,62,560);
inventoryItemSlot(inventory,58,99,560);
inventoryItemSlot(inventory,59,136,560);
inventoryItemSlot(inventory,60,173,560);
inventoryItemSlot(inventory,61,210,560);
inventoryItemSlot(inventory,62,247,560);
inventoryItemSlot(inventory,63,284,560);
inventoryItemSlot(inventory,64,25,600);
inventoryItemSlot(inventory,65,62,600);
inventoryItemSlot(inventory,66,99,600);
inventoryItemSlot(inventory,67,136,600);
inventoryItemSlot(inventory,68,173,600);
inventoryItemSlot(inventory,69,210,600);
inventoryItemSlot(inventory,70,247,600);
inventoryItemSlot(inventory,71,284,600);
}
}
*/
callBag(inventory,0,345,100);
callBag(inventory,1,515,100);
callBag(inventory,2,345,400);
callBag(inventory,3,515,400);
callBag(inventory,4,685,100);
callBag(inventory,5,855,100);
callBag(inventory,6,685,400);
callBag(inventory,7,855,400);
if (tooltipitem1 != null){
GUI.Box(Rect (tooltipx1,tooltipy1,100,100),tooltipitem1.itemname);
}
tooltipitem1 = null;
if (tooltipitem2 != null){
GUI.Box(Rect (tooltipx2,tooltipy2,100,100),tooltipitem2.itemname);
}
tooltipitem2 = null;
if (tooltipitem3 != null){
GUI.Box(Rect (tooltipx3,tooltipy3,100,100),tooltipitem3.itemname);
}
tooltipitem3 = null;
if (mouseheld){
mouseOver = GUI.tooltip;
}
}