示例#1
0
    private void PickupAction(Side itemSide, Interactable itemRef, Transform handPos)
    {
        // TO::DO need to fix this, should not be using targetItem, rather itemRef
        if (targetItem != null && targetItem.TryGetComponent(out Collectable collectable))
        {
            playerInventory.storage.AddItemToList(collectable.data, collectable.objectType);
            collectable.Interact(this);
        }

        if (itemRef == null)
        {
            if (targetItem != null && targetItem.canPickup)
            {
                playerInventory.AddHandItem(itemSide, targetItem, handPos, out bool addSuccess);
                playerUI.ShowHandHint(itemSide, addSuccess);
            }
        }
    }