public void EquipConsumable(ConsumableItem consumable, EquipmentSlotEnum equipmentSlotID) { MoveConsumableBackToInventory(equipmentSlotID); SetConsumableInSlot(consumable, equipmentSlotID); UpdateConsumableSlots(); }
private void MoveConsumableBackToInventory(EquipmentSlotEnum equipmentSlotID) { ConsumableItem equippedConsumable = GetEquippedConsumable(equipmentSlotID); if (equippedConsumable != null) { consumablesInInventory.Add(equippedConsumable); } }
private void LoadConsumables() { foreach (ConsumableEquipmentSlot slot in consumableEquipmentSlots) { ConsumableItem consumable = playerInventory.GetEquippedConsumable(slot.equipmentSlotID); if (consumable != null) { slot.AddItem(consumable); } } }
public void AddItem(ConsumableItem newConsumable) { if (newConsumable == null) { return; } consumable = newConsumable; icon.sprite = consumable.icon; icon.enabled = true; }
private void HandleUseItemInput() { if (useItem_Input) { if (!playerManager.isInteracting) { ConsumableItem equippedConsumable = playerInventory.consumable; consumableSlotManager.UseConsumable(equippedConsumable); } } }
public void UpdateConsumableUI(ConsumableItem consumable) { if (consumable == null) { consumableIcon.sprite = null; consumableIcon.enabled = false; } else { consumableIcon.sprite = consumable.icon; consumableIcon.enabled = consumable.icon != null; } }
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); } }
public override void UnequipItem() { consumable = null; base.UnequipItem(); }
private void UpdateConsumableSlots() { consumable = equippedConsumables[currentConsumableIndex]; consumableSlotManager.LoadConsumableOnQuickSlot(consumable); }
public void AddItem(ConsumableItem newItem) { consumable = newItem; base.AddItem(newItem); }
public override void ClearInventorySlot() { consumable = null; base.ClearInventorySlot(); }
public void UseConsumable(ConsumableItem consumable) { weaponSlotManager.UnloadWeaponOnSlot(WeaponSlotID.RightHandSlot); consumableSlot.LoadConsumableModel(consumable); animator.PlayTargetAnimation(consumable.useAnimation, true); }
public void LoadConsumableOnQuickSlot(ConsumableItem consumable) { quickSlotsUI.UpdateConsumableUI(consumable); }
public void LoadConsumableModel(ConsumableItem consumable) { LoadItemModel(consumable); currentConsumable = consumable; }