public bool AddInventoryItem(string thisTag) { bool _pickedUpItem = false; if (_myInventory.Count < 2) { if (!_myInventory.Contains(thisTag)) { _myInventory.Add(thisTag); _inventoryUI.AddInventory(thisTag); _pickedUpItem = true; } else { _errorMessages.DisplayErrorMessage("You already have this item.", false); _pickedUpItem = false; } } else { _errorMessages.DisplayErrorMessage("Inventory Full. Please discard an item.", false); _pickedUpItem = false; } /* * foreach (var item in _myInventory) * { * Debug.Log(item); * } */ return(_pickedUpItem); }
public void AddInventory() { GameObject selectToolButton = Instantiate(Resources.Load("ToolTemplate") as GameObject); inventoryUIScript.AddInventory(selectToolButton, toolIcon, toolName, SelectToolButton); }