Beispiel #1
0
    private void DropActiveItem(PointerEventData dropEvent, int inventorySlot)
    {
        Item dragItem = playerInventory.PullItemFromInventory("Weapon", int.Parse(dropEvent.pointerDrag.transform.name));
        Item dropItem = playerInventory.PullItemFromInventory("Weapon", inventorySlot);

        playerInventory.ItemInventory[inventorySlot] = dragItem;
        playerInventory.ItemInventory[int.Parse(dropEvent.pointerDrag.transform.name)] = dropItem;
        PopulateHoverData(dragItem);
        playerInventory.SaveInventory();
    }
Beispiel #2
0
    private void EquipTool()
    {
        if (equippedTool != null)
        {
            UnequipTool();
        }
        Tool tool = inventory.PullItemFromInventory("Tool", 0) as Tool;

        equippedTool = tool;
    }