Inventool Documentation
  • Inventool Documentation
  • đŸ•šī¸Quick Start
    • Installation
    • Start Creating
  • 💡General
    • Running the Demo
    • Menu Options
    • UI Updates
    • UI Customizations
      • uGUI
      • UI Toolkit
    • Custom Item Drops
  • 🎓Tutorials
    • Demo Walkthrough
  • âœī¸Editors
    • Inventool
      • Inventory
      • Equipment
      • Items
      • Currencies
      • Crafting
      • Dismantling
      • Enchanting
      • Stats
        • Stat IDs
        • Attributes
      • Settings
    • Item Type Manager
    • Localization Editor
    • Stats Editor
    • Merchants
      • Shopkeeper
      • Craftsman
      • Enchanter
    • Storage
    • Loot
      • Loot Box
      • Item Pouch
      • Currency Pouch
    • Components
      • Initializer
      • UI
        • uGUI
          • Inventool Window
          • Split UI
            • Inventory Window UGUI
            • Equipment Window UGUI
            • Key Items Window UGUI
            • Crafting Window UGUI
            • Enchanting Window UGUI
            • Storage Window UGUI
            • Shop Window UGUI
            • Selector UGUI
          • Action Menu UGUI
          • Hover Details UGUI
          • Confirm Prompt UGUI
          • Quantity Prompt UGUI
          • Character Viewer Element UGUI
        • UI Toolkit
          • Inventool Window
          • Split UI
            • Inventory Window
            • Equipment Window
            • Key Items Window
            • Crafting Window
            • Enchanting Window
            • Storage Window
            • Shop Window
          • Action Menu
          • Hover Details
          • Confirm Prompt
          • Quantity Prompt
        • Character Viewer
      • Overworld Merchant
      • Storage Keeper
      • Item Drop
      • Item Spawner
      • Input
        • Cross Input Support
        • Cross Input Support UGUI
          • Target Selectable
  • 📄Scripting API
    • Initialization
    • Inventory
    • Equipment
      • Equipment Slot
    • Items
      • Item
      • Item Type
      • Item Stack
      • Item Drop
      • Item Spawner
      • Loot Box
      • Item Pouch
    • Currencies
      • Currency Identity
      • Currency
        • Value
      • Currency Pouch
    • Crafting
      • Craft
      • Crafter
    • Enchanting
      • Enchantment
    • Stats
      • Stat Identity
      • Attribute
      • Stat
        • Stat Value
          • Value
        • Effectiveness
      • Stat Profile
    • Storing
      • Storage
      • Storage Keeper
    • Settings
    • Merchants
      • Shopkeeper
      • Craftsman
      • Enchanter
      • Overworld Merchant
    • UI
      • uGUI
        • Inventool Window UGUI
        • Split UI
          • Draggable Window UGUI
            • Inventory Window UGUI
            • Equipment Window UGUI
            • Key Items Window UGUI
            • Crafting Window UGUI
            • Enchanting Window UGUI
            • Storage Window UGUI
            • Shop Window UGUI
          • Selector UGUI
        • Action Menu UGUI
        • Hover Details UGUI
        • Confirm Prompt UGUI
        • Quantity Prompt UGUI
        • Draggable Element UGUI
          • Equipment Slot Element UGUI
          • Item Slot Element UGUI
          • Item Stack Element UGUI
        • Action Menu Option UGUI
        • Currency Element UGUI
        • Inventory Filter UGUI
        • Inventory Slot UGUI
        • Key Item Element UGUI
        • Shop Item Element UGUI
        • Storage Currency Element UGUI
        • Stat Element UGUI
      • UI Toolkit
        • Inventool Window
        • Split UI
          • Draggable Window
            • Inventory Window
            • Equipment Window
            • Key Items Window
            • Crafting Window
            • Enchanting Window
            • Storage Window
            • Shop Window
        • Action Menu
        • Hover Details
        • Confirm Prompt
        • Quantity Prompt
        • Item Elements
          • Item Stack Element
          • Equipment Slot Element
          • Item Slot Element
          • Shop Item Element
      • Action Menu Option
      • Character Viewer
    • Events
    • Sounds
    • Saving & Loading
      • Inventory & Equipment
      • Storage
    • Input
      • Cross Input Support
      • Cross Input Support UGUI
    • Localization
      • Localization Settings
      • Localizer
  • đŸ› ī¸Support
    • Getting Help
  • 📚Changelogs
    • Latest Releases
    • Future Plans
  • ⭐Rate Me?
Powered by GitBook
On this page
  • Accessing the Equipment
  • Fields & Properties
  • Equipment Slots
  • Adding Slots
  • Getting Slots
  • Removing Slots
  • Equipping
  • Checking Item Equipped State
  • Equip An Item
  • Unequipping
  • Unequip An Item
  • Unequip All
  1. Scripting API

Equipment

Scripting with the Equipment class.

The Equipment class serves as the settings and functionality of the inventory's equipment section. All fields listed in the Equipment tab of the Inventool editor window are public and can be changed at runtime.

NOTE: Runtime edits of the equipment are not saved automatically. This would need to be done manually.

When making edits to the equipment, relevant parts of the Inventool Window may need to be refreshed.

Accessing the Equipment

You can access the player's equipment with Inventool.Equipment.

Fields & Properties

Name
Description
Type
Access

rotationType

The character viewer rotation type.

Equipment.RotationType

public

characterImage

A character image to use instead of the 3D character viewer. This is meant for 2D games only.

Sprite

public

slots

A list of all created equipment slots.

List<EquipmentSlot>

public

Equipment Slots

The equipment uses Equipment Slot as it's slots.

Adding Slots

Inventool.Equipment.slots.Add(mySlot);

Getting Slots

You can access the full list of slots with the slots field.

Check If A Slot Exists

bool result = Inventool.Equipment.HasSlot("My Slot Name");

Get Slot By Name

EquipmentSlot slot = Inventool.Equipment.GetSlot("My Slot Name");

Get Slot At Position

// Get slot at position 0
EquipmentSlot slot = Inventool.Equipment.GetSlot(0);

Get Slot With A Specific Item Stack

EquipmentSlot slot = Inventool.Equipment.GetSlot(myItemStack);

Get First Slot of An Item Type

EquipmentSlot slot = Inventool.Equipment.GetSlot(myItemType);

Removing Slots

Inventool.Equipment.slots.Remove(mySlot);

Equipping

Checking Item Equipped State

The IsEquipped method checks if an Item Stack or Item is currently equipped at any slot.

bool result = Inventool.Equipment.IsEquipped(myItem);

Equip An Item

The TryEquip method attempts to equip an ItemStack at the first slot possible. This method returns true if the item was successfully equipped. This may fail if there isn't a slot that can equip the item.

bool result = Inventool.Equipment.TryEquip(itemStack);

Unequipping

Unequip An Item

The TryUnequip method attempts to unequip an ItemStack. This method returns true if the item was successfully unequipped. This will only fail if the item stack was not equipped.

bool result = Inventool.Equipment.TryUnequip(itemStack);

Unequip All

The UnequipAll method unequips all item stacks from all slots.

Inventool.Equipment.UnequipAll();
PreviousInventoryNextEquipment Slot

Last updated 3 months ago

📄