public void LoadCurrentItemOnEquipmentSlot()
        {
            if (currentItem == null)
            {
                return;
            }

            if (currentItem is Items.ClothItem)
            {
                currentItem.isEquiped = true;
                UI_Slot slot = GetEquipmentSlot(currentItem.bodyPart);
                if (slot.itemInstance != null)
                {
                    SetItemOnStoredSlot(slot.itemInstance);
                }

                slot.LoadItem(currentItem);
                StoreIdOnResources(currentItem, slot);
                LoadItemsOnCharacter();

                currentItem = null;
            }
            else
            {
                //we droped a weapon on our character
            }
        }
Пример #2
0
        public override void OnDropItem(UI_Slot slot, Item item, UI_InventoryManager invManager)
        {
            Item previousItem = slot.itemInstance;

            slot.LoadItem(item);
            item.isEquiped = false;
            invManager.ClearCurrentItem();
            invManager.UnEquipFromStoredSlot();

            if (previousItem != null)
            {
                invManager.SetItemOnStoredSlot(previousItem);
            }
        }
        public void LoadItemOnTargetEquipmentSlot(Items.Item item, bool isLeft)
        {
            item.isEquiped = true;

            UI_Slot slot = null;

            if (item is Items.Weapon)
            {
                slot = GetWeaponEquipmentSlot(isLeft);
            }
            else
            {
                slot = GetEquipmentSlot(item.bodyPart);
            }

            slot.LoadItem(item);
            StoreIdOnResources(item, slot);
        }
Пример #4
0
        public override void OnDropItem(UI_Slot slot, Item item, UI_InventoryManager invManager)
        {
            if (item.bodyPart == slot.bodyPart)
            {
                Item previousItem = slot.itemInstance;
                slot.LoadItem(item);
                item.isEquiped = true;
                invManager.UnEquipFromStoredSlot();
                invManager.StoreIdOnResources(item, slot);
                invManager.LoadItemsOnCharacter();
                invManager.ClearCurrentItem();

                if (previousItem != null)
                {
                    previousItem.isEquiped = false;
                    invManager.SetItemOnStoredSlot(previousItem);
                }
            }
        }
 public void SetItemOnStoredSlot(Items.Item targetItem)
 {
     storedSlot.LoadItem(targetItem);
 }