Item Type
🏷️ ItemType Class
A type of item. Item types are used to set commonalities of a group of items and are also useful for filtering items in the inventory.
Namespace:
Esper.Inventool.Items
Access:public
Type:class
Inherits:InventoolObject
📦 Fields
public
displayName
string
The display name of this type shown in‑game.
public
localizedDisplayNameKey
string
The key of the localized display name string.
public
icon
Sprite
The item type icon displayed in the inventory filter list.
public
iconColorTint
Color
The color tint of the icon.
public
parent
ItemType
The parent item type. null
if not a subtype.
public
enchantmentMode
EnchantmentMode
The enchantment mode of this item type.
public
sortingOrder
int
The order in which this type appears in the inventory filter list. Lower values appear first.
public
equippable
bool
If this item type supports equipping.
public
consumable
bool
If this item type supports consuming.
public
stackable
bool
If stacking is possible for items of this type.
public
droppable
bool
If the player can manually drop items of this type.
public
sellable
bool
If items of this type can be sold in marketplaces.
🔍 Properties
public
IsSubtype
bool
If this type is a subtype of another.
public
IsEnchantable
bool
If items of this type can be enchanted.
public
IsEnchanter
bool
If items of this type can be used for enchanting.
🧰 Methods
public
GetLocalizedDisplayName()
string
Gets the localized display name string.
public static
Create(ItemType parent)
ItemType
Creates a new instance of an item type (editor only).
public
UpdateAssetName()
(Editor only)
void
Updates the name of the asset.
public static
GetFullPath(ItemType itemType)
(Editor only)
string
Gets the full path of an item type.
🧩 Nested Types
public enum EnchantmentMode
public enum EnchantmentMode
Defines the enchantment behavior of an item type.
None
Items of this type cannot be enchanted or used for enchanting.
Enchantable
Items of this type can be enchanted.
Enchanter
Items of this type can be used for enchanting.
Both
Items of this type can be enchanted and used for enchanting.
Creating Item Types
It's not at all recommended to create item types at runtime, but it is possible. Item types are scriptable objects which cannot be created as assets at runtime for later use. You would need to load your generated item types on your own.
ItemType myItemType = ScriptableObject.CreateInstance<ItemType>();
Item type IDs must be unique. When creating item types from the Item Type Manager, unique IDs are set automatically. However, this is not done when creating item types at runtime. You'd need to create your own method of ensuring IDs of generated item types are unique.
Getting Item Types
Single Item Type
You can get item types by their name or ID with the GetItemType
method.
ItemType myItemType = Inventool.GetItemType("My Item Type Name");
Get All Item Types
var itemTypes = Inventool.GetAllItemTypes();
Get All Parent Item Types
var itemTypes = Inventool.GetAllParentItemTypes();
Get All Sub Item Types
var itemTypes = Inventool.GetAllSubItemTypes();
Last updated