InventorySlot
When using the Inventory or Chests in FPS Engine, Players will interact with InventorySlots. InventorySlot contains information about items, quantities & handles interactions between the InventoryProManager and the Player.
iconImage: Image that dipslays the Icon of the Item held by this InventorySlot
amountText: Text that shows the current amount or quantity stored in the slot data of this inventory slot.
backgroundImage: Background of the Slot. This is coloured to indicate if the Slot is Available or occupied when hovered while dragging an object.
Inventory Slot Interactions
highlightedScale: Inventory Slot object Scale when hovered/highlighted
highlightedBorder: GameObject that gets enabled when the InventorySlot is highlighted. This particularly simulates a border.
lerpSpeed: Speed to lerp from the default scale to the highlightedScale
iconImageMargins: Adjusts Icon Image Spacing to properly fit the Icons in the Slot
inventoryContainer: Object that contains the entire Inventory Slot
Functions | InventorySlot.cs
UpdateSlotGraphics()
Updates a specific InventorySlot visuals. Displays the Icon of the stored Item in SlotData, and displays the amount ( If Item is not null ). In case Item is null, it will reset the graphics to the default/blank state.
ClearSlot()
Resets the Slot Data of an Ivnentory Slot & Updates its Visuals
GahterSprite()
Returns proper Item Sprite based on sizing and availability.
GatherName()
Returns proper Item Name based on availability.
GatherDescription()
Returns proper Item Description based on availability.
GetAnchorSlot()
Returns current Anchor Slot. If Anchor Slot is null, it will return itself, as it cannot be anchored to anything else.
IsHotbarSlot()
Returns true if this is a hotbar slot.
IsInventorySlot()
Returns true if this is an Inventory slot.
IsChestSlot()
Returns true if this is a Chest slot.
GatherSlotType()
Returns Slot Type directly.
HasValidItem()
Returns true if SlotData of this InventorySlot contains a valid Item.
IsItemWeapon()
Returns true if the Item in Slot Data is a Weapon_SO
IsItemAttachment()
Returns true if the Item in Slot Data is a AttachmentIdentifier_SO
IsItemBullets()
Returns true if the Item in Slot Data is a BulletsItem_SO
GetItemSize()
Returns the Item Size of the Item in SlotData.
If Item is null, a default 1x1 size will be returned.
Select()
Highlights this Inventory Slot and represents it visually. Often used by Gamepad / Controller.
Unselect()
Unselects this slot and represents it visually. Often used by Gamepad / Controller.
Last updated