1. Home
  2. S-Inventory
  3. Skill Bar
  4. Skill Bar Slots

Skill Bar Slots

  • Show Skill Bar: Set to true if you want to enable the skill bar feature.
  • Skill Slots: Set the size of the “Skill Slots” array to the amount of skill slots you want to have in the game. Then define each slot by:
  • Name: Name of the skill slot.
  • Multiple Items: Set to true if you want the skill slot to include multiple items of the same item. If false then the skill slot will only take one.
  • Icon: Create a new UI Image object with the empty slot as the sprite and make it child of the skill bar UI panel.
  • Create another UI Image object as a child object of the empty slot and call it “Icon”. In the “Icon” object, add the “SlotUI” script and set “SkillBarItem” only to true then add an Event Trigger with the following event:
  1. Pointer Click event: Drag and drop the “Icon” object and select: “SlotUI -> SendSkillBarClick()”.
  2. Begin Drag event: Drag and drop the “Icon”object and select: “SlotUI -> DragItem()”.
  3. End Drag event: Drag and drop the “Icon” object and select: “SlotUI -> DisableItemDrag()”.
  4. Pointer Enter event: Drag and drop the “Icon” object and select: “SlotUI -> HoverON()” and “SlotUI -> SetDragDestination()”.
  5. Pointer Exit event: Drag and drop the “Icon” object and select: “SlotUI -> HoverOFF()” and “SlotUI -> RemoveDragDestination()”.
  6. Then create a new UI Text object, call it “Text” and place it as a child of the “Icon” object. Finally, place the “Icon” objects in their respective fields in the skill bar slots array.
  • Trigger Key: To activate a skill from the skill bar, you can double click on the slot or this press the key assigned in this field.
  • Destroy On Use: Set to true when you want to destroy the item after using it in the skill bar.
  • Use Cooldown: Set to a value (in minutes) greater than 0 if you want to have a cooldown between each use of a skill bar item.
  • Default Item: This is a prefab that exists in your project files and which has the “Item.cs” component. This prefab has default settings and will be used in loading saved items. There’s one ready default item in the project: S-Inventory -> Default Item.
  • Save and load: Check this option if you want to save items and load them when the game starts. To load items’ sprites (icons), you need to place all the sprites inside a folder called “Resources”. Make sure that you give the texture the same name as the “Name” field in the “Item.cs” component to load it properly.

How can we help?