Пример #1
0
    public override void OnPointerUp(PointerEventData data)
    {
        base.OnPointerUp(data);

        if (data.button == PointerEventData.InputButton.Left)
        {
            if (_canUseLinkednItem)
            {
                UseLinkedItem();
                return;
            }

            ItemSlot slotHit = uIItemManager.CastToItemSlot(RectTransform.position);

            if (slotHit != null)
            {
                if (slotHit.GetType() == typeof(EquipmentSlot))
                {
                    EquipmentSlot es = (EquipmentSlot)slotHit;
                    es.Slot(this);
                    _slot = es;
                }

                else if (slotHit.GetType() == typeof(StorageSlot))
                {
                    StorageSlot   ss = (StorageSlot)slotHit;
                    StorageWindow sw = ss.StorageWindow;
                    if (sw != null)
                    {
                        sw.Slot(ss, this, true);
                        _storageWindow = sw;
                        _slot          = ss;
                    }
                }
            }
            else
            {
                Debug.Log("No Slot");
                LinkedItem.Drop(new object[] { gameManager.Actor.Character.transform.position });
            }
        }
    }
Пример #2
0
    public void PickUpItem(Item item)
    {
        EquipmentSlot potentailSlot = equipment.CheckEquipmentSlots(item.UIItem);

        if (potentailSlot)
        {
            item.PickUp(false);
            potentailSlot.Slot(item.UIItem);
        }
        else
        {
            bool stored = _equipmentManager.storage.Store(item);
            if (!stored)
            {
                item.PickUp(true);
                equipment.OpenWindow();
            }
            else
            {
                item.PickUp(false);
            }
        }
    }
Пример #3
0
 public void EquipLeftHand(Equipable e)
 {
     leftHand.Slot(e.UIItem);
 }
Пример #4
0
 public void EquipRightHand(Equipable e)
 {
     rightHand.Slot(e.UIItem);
 }