Пример #1
0
        public void EquipConsumable(ConsumableItem consumable, EquipmentSlotEnum equipmentSlotID)
        {
            MoveConsumableBackToInventory(equipmentSlotID);
            SetConsumableInSlot(consumable, equipmentSlotID);

            UpdateConsumableSlots();
        }
Пример #2
0
        private void MoveConsumableBackToInventory(EquipmentSlotEnum equipmentSlotID)
        {
            ConsumableItem equippedConsumable = GetEquippedConsumable(equipmentSlotID);

            if (equippedConsumable != null)
            {
                consumablesInInventory.Add(equippedConsumable);
            }
        }
Пример #3
0
 private void LoadConsumables()
 {
     foreach (ConsumableEquipmentSlot slot in consumableEquipmentSlots)
     {
         ConsumableItem consumable = playerInventory.GetEquippedConsumable(slot.equipmentSlotID);
         if (consumable != null)
         {
             slot.AddItem(consumable);
         }
     }
 }
Пример #4
0
        public void AddItem(ConsumableItem newConsumable)
        {
            if (newConsumable == null)
            {
                return;
            }

            consumable   = newConsumable;
            icon.sprite  = consumable.icon;
            icon.enabled = true;
        }
Пример #5
0
 private void HandleUseItemInput()
 {
     if (useItem_Input)
     {
         if (!playerManager.isInteracting)
         {
             ConsumableItem equippedConsumable = playerInventory.consumable;
             consumableSlotManager.UseConsumable(equippedConsumable);
         }
     }
 }
Пример #6
0
 public void UpdateConsumableUI(ConsumableItem consumable)
 {
     if (consumable == null)
     {
         consumableIcon.sprite  = null;
         consumableIcon.enabled = false;
     }
     else
     {
         consumableIcon.sprite  = consumable.icon;
         consumableIcon.enabled = consumable.icon != null;
     }
 }
Пример #7
0
        private void SetConsumableInSlot(ConsumableItem consumable, EquipmentSlotEnum equipmentSlotID)
        {
            switch (equipmentSlotID)
            {
            case EquipmentSlotEnum.ConsumableSlot01:
                equippedConsumables[0] = consumable;
                break;

            case EquipmentSlotEnum.ConsumableSlot02:
                equippedConsumables[1] = consumable;
                break;

            case EquipmentSlotEnum.ConsumableSlot03:
                equippedConsumables[2] = consumable;
                break;

            case EquipmentSlotEnum.ConsumableSlot04:
                equippedConsumables[3] = consumable;
                break;

            case EquipmentSlotEnum.ConsumableSlot05:
                equippedConsumables[4] = consumable;
                break;

            case EquipmentSlotEnum.ConsumableSlot06:
                equippedConsumables[5] = consumable;
                break;

            case EquipmentSlotEnum.ConsumableSlot07:
                equippedConsumables[6] = consumable;
                break;

            case EquipmentSlotEnum.ConsumableSlot08:
                equippedConsumables[7] = consumable;
                break;
            }

            if (consumable != null)
            {
                consumablesInInventory.Remove(consumable);
            }
        }
Пример #8
0
 public override void UnequipItem()
 {
     consumable = null;
     base.UnequipItem();
 }
Пример #9
0
 private void UpdateConsumableSlots()
 {
     consumable = equippedConsumables[currentConsumableIndex];
     consumableSlotManager.LoadConsumableOnQuickSlot(consumable);
 }
Пример #10
0
 public void AddItem(ConsumableItem newItem)
 {
     consumable = newItem;
     base.AddItem(newItem);
 }
Пример #11
0
 public override void ClearInventorySlot()
 {
     consumable = null;
     base.ClearInventorySlot();
 }
Пример #12
0
 public void UseConsumable(ConsumableItem consumable)
 {
     weaponSlotManager.UnloadWeaponOnSlot(WeaponSlotID.RightHandSlot);
     consumableSlot.LoadConsumableModel(consumable);
     animator.PlayTargetAnimation(consumable.useAnimation, true);
 }
Пример #13
0
 public void LoadConsumableOnQuickSlot(ConsumableItem consumable)
 {
     quickSlotsUI.UpdateConsumableUI(consumable);
 }
Пример #14
0
 public void LoadConsumableModel(ConsumableItem consumable)
 {
     LoadItemModel(consumable);
     currentConsumable = consumable;
 }