Exemple #1
0
    // 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();
        }
    }
Exemple #2
0
 void OnItemDropped(ItemSlot slot)
 {
     inventory.Add(slot.Item, slot.Index);
 }