public void EquipThisItem()
        {
            if (uiManager.rightHandSlot01Selected)
            {
                playerInventory.weaponsInventory.Add(playerInventory.playerProfile.weaponsInRightHandSlot[0]);
                playerInventory.playerProfile.weaponsInRightHandSlot[0] = item;
                playerInventory.weaponsInventory.Remove(item);
            }
            else if (uiManager.rightHandSlot02Selected)
            {
                playerInventory.weaponsInventory.Add(playerInventory.playerProfile.weaponsInRightHandSlot[1]);
                playerInventory.playerProfile.weaponsInRightHandSlot[1] = item;
                playerInventory.weaponsInventory.Remove(item);
            }
            else if (uiManager.leftHandSlot01Selected)
            {
                playerInventory.weaponsInventory.Add(playerInventory.playerProfile.weaponsInLeftHandSlot[0]);
                playerInventory.playerProfile.weaponsInLeftHandSlot[0] = item;
                playerInventory.weaponsInventory.Remove(item);
            }
            else if (uiManager.leftHandSlot01Selected)
            {
                playerInventory.weaponsInventory.Add(playerInventory.playerProfile.weaponsInLeftHandSlot[1]);
                playerInventory.playerProfile.weaponsInLeftHandSlot[1] = item;
                playerInventory.weaponsInventory.Remove(item);
            }
            else
            {
                return;
            }
            //remove current item
            //add current item to inven
            //remove this item from inven
            playerInventory.rightWeapon = playerInventory.playerProfile.weaponsInRightHandSlot[playerInventory.currentRightWeaponIndex];
            playerInventory.leftWeapon  = playerInventory.playerProfile.weaponsInLeftHandSlot[playerInventory.currentLeftWeaponIndex];

            weaponSlotManager.LoadWeaponOnSlot(playerInventory.rightWeapon, false);
            weaponSlotManager.LoadWeaponOnSlot(playerInventory.leftWeapon, true);

            uiManager.equipmentWindowUI.LoadWeaponsOnEquipmentScreen(playerInventory);
            uiManager.ResetAllSelectedSlots();
        }
Пример #2
0
        private void HandleTwoHandInput()
        {
            if (y_Input)
            {
                y_Input     = false;
                twoHandFlag = !twoHandFlag;

                if (twoHandFlag)
                {
                    //Enable
                    weaponSlotManager.LoadWeaponOnSlot(playerInventory.rightWeapon, false);
                }
                else
                {
                    //disable
                    weaponSlotManager.LoadWeaponOnSlot(playerInventory.rightWeapon, false);
                    weaponSlotManager.LoadWeaponOnSlot(playerInventory.leftWeapon, true);
                }
            }
        }
        private void Start()
        {
            //weapon
            rightWeapon = playerProfile.weaponsInRightHandSlot[0];
            leftWeapon  = playerProfile.weaponsInLeftHandSlot[0];
            weaponSlotManager.LoadWeaponOnSlot(rightWeapon, false);
            weaponSlotManager.LoadWeaponOnSlot(leftWeapon, true);

            //gear
            currentHelmetEquipment = playerProfile.helmetInSlot[0];

            currentChestArmorEquipment = playerProfile.chestArmorInSlot[0];

            currentBottomArmorEquipment = playerProfile.bottomArmorInSlot[0];

            //item
            currentConsumable = playerProfile.itemInSlot[0];
            LoadItemOnSlot(currentConsumable);

            //spell
            currentSpell = playerProfile.spellInSlot[0];
            LoadSpellOnSlot(currentSpell);
        }