Ejemplo n.º 1
0
    protected override bool OnInteractionBoxPressed(InteractionBox box, HandManager hand)
    {
        /* Get the item slot from the interaction box */
        UIItemSlot itemSlot = box.GetGameObject().GetComponent <UIItemSlot>();

        if (itemSlot == null)
        {
            return(false);
        }

        /* The store manager has to be setup */
        if (storeManager == null)
        {
            return(false);
        }

        /* See if either of our slot managers own this slot */
        bool catalogueOwnsSlot = barteringCatalogue.OwnsSlot(itemSlot);

        /* Get the item from the slot */
        SojournItem transfoerSojournItem = itemSlot.GetItem();

        if (transfoerSojournItem == null)
        {
            return(true);
        }
        Item transfer = transfoerSojournItem.GetItem();

        if (transfer == null)
        {
            return(true);
        }

        if (catalogueOwnsSlot)
        {
            CmdTransferFromStoreToInventory(storeManager.GetComponent <NetworkIdentity>().netId, transfer.item_name);
        }

        return(true);
    }