Null Bolt
Studio
guides

Equipment & hotbar

A typed paper-doll for RPG loadouts and a hotbar that turns digit keys into gameplay events. Both accept drag-and-drop from any other inventory.

The equipment paper-doll

EquipmentController manages a list of EquipmentSlot children, each declaring which slot types it accepts. Drag a helm from the bag onto the helm slot and it equips; drag it onto the boots slot and it snaps back. The fastest way to get one is WindowNullBoltInventory SystemCreateEquipment Panel in Scene — an 11-slot anatomical layout (helm, amulet, chest, gloves, main/off hand, belt, two rings, legs, boots) with ghost silhouettes per slot.

Equipment paper-doll panel with typed slots and some equipped items
The Create menu's 11-slot paper-doll. Empty slots show a ghost silhouette of what belongs there.
Validation ruleDescription
Typed slotsA slot lists its accepted EquipmentSlotTypes; an item declares one via ItemData.EquipSlot. Equipping requires a match, an empty slot, and IsEquippable.
15 slot typesNone, Helm, Chest, Legs, Boots, Gloves, Shoulders, Cloak, MainHand, OffHand, Ring1, Ring2, Amulet, Belt, Trinket — stable ints, safe to persist.
"Any ring" slotsA slot may accept several types — list both Ring1 and Ring2 on one slot and either ring fits.
Equipment from code
C#
using InventorySystem;

equipment.Equip(helmData);          // first matching empty slot
equipment.EquipAt(ringData, 7);     // a specific slot index
equipment.Unequip(7);

equipment.OnItemEquipped   += (item, slotType) => RecalculateStats();
equipment.OnItemUnequipped += (item, slotType) => RecalculateStats();
// note
The controller is gameplay-neutral by design — it validates types and raises events but computes no stats. Subscribe to OnItemEquipped/OnItemUnequipped and apply your own stat logic there.

Rendering is handled by EquipmentPanelUI in one of two modes: LabeledList auto-generates a label + slot row per entry (zero layout work), while Free binds pre-placed slot visuals for full paper-doll layouts — that's what the Create menu generates.

The hotbar

HotbarController extends the slot inventory with digit-key input: 19 map to the first nine slots and 0 to the tenth (offset by Base Slot if set). Slots within key range get a small gold key chip in the corner automatically. Activating a slot — by key or by left-click — raises one event:

The only event you need
C#
using InventorySystem;

hotbar.OnSlotActivated += (slotIndex, item) =>
{
    if (item == null) { Sfx.Play("empty_click"); return; }   // empty slots still fire

    switch (item.ItemData.Category)
    {
        case ItemCategory.Consumable: Drink(item);  break;
        case ItemCategory.Weapon:     Wield(item);  break;
    }
};
A hotbar with gold digit chips and an activation label, as seen in the Survival demo's quickbar
A hotbar with keybind chips — the Survival demo's quickbar. The HotbarActivationLabel component above it fades in a “[2] Combat Knife”-style readout on each activation; its source is a ready-made example of consuming OnSlotActivated.
MemberTypeDescription
ActivateSlot(int)boolTrigger a slot from your own input code (gamepad, rebindable actions). Returns false when out of range.
ListenForNumberKeysboolDisable the built-in digit polling entirely and drive activation yourself.
BaseSlotintOffsets which slot the “1” key targets — useful for multi-row bars.
// heads up
Digit-key polling uses the new Input System package. With only the legacy Input Manager, drags still work but hotbar keys stay silent — call ActivateSlot from your own input handling instead. Try it instantly with WindowNullBoltInventory SystemScene ToolsAdd Hotbar Showcase To Open Scene.

Cross-inventory drag, for free

Grid, slots, hotbar, and equipment all implement IInventory, and every drag handler routes through the same transfer pipeline — so bag→hotbar, bag→equipment, stash→bag, and equipment→shop drags all work with no configuration. Failed transfers roll the item back to where it came from.