示例#1
0
 public void ClearItem()
 {
     consumableItem = null;
     icon.sprite    = null;
     icon.enabled   = false;
     gameObject.SetActive(false);
 }
示例#2
0
 public void AddItem(ConsumableItem newItem)
 {
     consumableItem = newItem;
     icon.sprite    = consumableItem.itemIcon;
     icon.enabled   = true;
     gameObject.SetActive(true);
 }
 public void UpdateItemQuickSlotUI(ConsumableItem item)
 {
     if (item.itemIcon != null)
     {
         consumableIcon.sprite  = item.itemIcon;
         consumableIcon.enabled = true;
     }
     else
     {
         consumableIcon.sprite  = null;
         consumableIcon.enabled = false;
     }
 }
        public void ChangeConsumableItem()
        {
            currentItemIndex = currentItemIndex + 1;
            if (currentItemIndex == 0 && playerProfile.itemInSlot[0] != null)
            {
                currentConsumable = playerProfile.itemInSlot[currentItemIndex];
                LoadItemOnSlot(playerProfile.itemInSlot[currentItemIndex]);
            }
            else if (currentItemIndex == 0 && playerProfile.itemInSlot[0] == null)
            {
                currentItemIndex = currentItemIndex + 1;
            }
            else if (currentItemIndex == 1 && playerProfile.itemInSlot[1] != null)
            {
                currentConsumable = playerProfile.itemInSlot[currentItemIndex];
                LoadItemOnSlot(playerProfile.itemInSlot[currentItemIndex]);
            }
            else if (currentItemIndex == 1 && playerProfile.itemInSlot[1] == null)
            {
                currentItemIndex = currentItemIndex + 1;
            }
            else if (currentItemIndex == 2 && playerProfile.itemInSlot[2] != null)
            {
                currentConsumable = playerProfile.itemInSlot[currentItemIndex];
                LoadItemOnSlot(playerProfile.itemInSlot[currentItemIndex]);
            }
            else if (currentItemIndex == 2 && playerProfile.itemInSlot[2] == null)
            {
                currentItemIndex = currentItemIndex + 1;
            }
            else if (currentItemIndex == 3 && playerProfile.itemInSlot[3] != null)
            {
                currentConsumable = playerProfile.itemInSlot[currentItemIndex];
                LoadItemOnSlot(playerProfile.itemInSlot[currentItemIndex]);
            }
            else if (currentItemIndex == 3 && playerProfile.itemInSlot[3] == null)
            {
                currentItemIndex = currentItemIndex + 1;
            }

            if (currentItemIndex > playerProfile.itemInSlot.Length - 1)
            {
                currentItemIndex  = 0;
                currentConsumable = playerProfile.itemInSlot[currentItemIndex];
                LoadItemOnSlot(playerProfile.itemInSlot[currentItemIndex]);
            }
        }
        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);
        }
 public void LoadItemOnSlot(ConsumableItem consumableItem)
 {
     quickSlotsUI.UpdateItemQuickSlotUI(consumableItem);
 }