Пример #1
0
 public void registerInventory(scrInventory inv)
 {
     if (!Inventories.Contains(inv))
     {
         Inventories.Add(inv);
     }
 }
Пример #2
0
 public void deregisterInventory(scrInventory inv)
 {
     if (Inventories.Contains(inv))
     {
         Inventories.Remove(inv);
     }
 }
Пример #3
0
 // Start is called before the first frame update
 void Start()
 {
     inventory = GetComponent <scrInventory>();
     inventory.SetOwnerId(GetInstanceID());
     Items = scroItems.Instance;
     Items.GetRandomItemList(10, inventory.contents);
 }
Пример #4
0
    // Start is called before the first frame update
    void Start()
    {
        lua = new Lua();
        lua.LoadCLRPackage();

        inventory = GetComponent <scrInventory>();
        if (inventory != null)
        {
            inventory.SetOwnerId(GetInstanceID());
        }
    }
Пример #5
0
        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);
        }