// Update is called once per frame void Update() { if (Input.GetButton("Pick")) { foreach (var sceneItem in pickableItem) { Item item = sceneItem.Item; if (null != item) { inventory.Add(item); } Destroy(sceneItem.gameObject); } pickableItem.Clear(); } }
void OnItemDropped(ItemSlot slot) { inventory.Add(slot.Item, slot.Index); }