public void registerInventory(scrInventory inv) { if (!Inventories.Contains(inv)) { Inventories.Add(inv); } }
public void deregisterInventory(scrInventory inv) { if (Inventories.Contains(inv)) { Inventories.Remove(inv); } }
// Start is called before the first frame update void Start() { inventory = GetComponent <scrInventory>(); inventory.SetOwnerId(GetInstanceID()); Items = scroItems.Instance; Items.GetRandomItemList(10, inventory.contents); }
// Start is called before the first frame update void Start() { lua = new Lua(); lua.LoadCLRPackage(); inventory = GetComponent <scrInventory>(); if (inventory != null) { inventory.SetOwnerId(GetInstanceID()); } }
public int CheckItem(scrInventory inv, string item, int qty) { int rq = 0; if (inv.contents.ContainsKey(item)) { int q = inv.contents[item]; if (q >= qty) { rq = qty; } else { rq = q; } } return(rq); }