Exemple #1
0
        public void Remove()
        {
            if (slot != null)
            {
                if (inventory.QuickTabList.Exists(x => x.name == slot.Item.Tab.TabName))
                {
                    if (slot.Item is Consum)
                    {
                        inventory.invenSlotManager.LastRefreshedTab.Add(ItemData.ConsumItemClone(slot.Item.Name) as SlotItem, true);
                    }

                    if (slot.Item is Equipment)
                    {
                        inventory.invenSlotManager.LastRefreshedTab.Add(ItemData.EquipmentItemClone(slot.Item.Name) as SlotItem, true);
                    }

                    if (slot.Item is CommonItem)
                    {
                        inventory.invenSlotManager.LastRefreshedTab.Add(ItemData.CommonItemClone(slot.Item.Name) as SlotItem, true);
                    }
                } //퀵슬롯일 경우 착용 해제 (제거 후 재추가)

                slot.Item.Tab.Remove(slot.Item);

                SlotManager.RefreshAll();
                Cancel();
            }
        }
Exemple #2
0
        public void Use()
        {
            if (slot != null)
            {
                if (SelectWidget == Widget.Shop)
                {
                    // 아이템을 구매하고 각각 다른 인벤토리에 저장할경우 inventory.InvenTabList[0].name 를 수정해서 사용한다
                    if (slot.Item is Consum)
                    {
                        slot.Item = ItemData.ConsumItemClone(slot.Item.Name);
                    }
                    else if (slot.Item is Equipment)
                    {
                        slot.Item = ItemData.EquipmentItemClone(slot.Item.Name);
                    }
                    else if (slot.Item is CommonItem)
                    {
                        slot.Item = ItemData.CommonItemClone(slot.Item.Name);
                    }
                    ShopHelper.Buy(ref InventoryManager.money, slot.Item, TabManager.GetTab(inventory.InvenTabList[0].name), () => Debug.Log("돈이 부족합니다"), () => Debug.Log("탭이 꽉찼습니다"));
                    InventoryManager.MoneyRefresh();
                    SlotManager.RefreshAll();

                    Cancel();
                }
                else
                {
                    slot.itemHandler.Use(slot, slot.Item);
                    SlotManager.RefreshAll();
                    Cancel();
                }
            }
        }
Exemple #3
0
        public void Sell()
        {
            if (slot != null)
            {
                ShopHelper.Sell(ref InventoryManager.money, slot.Item);

                InventoryManager.MoneyRefresh();
                SlotManager.RefreshAll();
                Cancel();
            }
        }