Beispiel #1
0
 void OpenBag()
 {
     isOpen = myBag.activeSelf;
     if (Input.GetKeyDown(KeyCode.B))
     {
         isOpen = !isOpen;
         myBag.SetActive(isOpen);
         InventorManager.RefreshItem();
     }
 }
Beispiel #2
0
    public void AddNewItem()
    {
        if (!playerInventory.itemList.Contains(thisItem))
        {
            for (int i = 0; i < playerInventory.itemList.Count; i++)
            {
                if (playerInventory.itemList[i] == null)
                {
                    playerInventory.itemList[i] = thisItem;
                    break;
                }
            }
        }
        else
        {
            thisItem.itemHeld += 1;
        }

        InventorManager.RefreshItem();
    }