Item Type, Definition & Category

Item Categories and Definitions are used to keep the inventory and items organizeed.

Item Categories

ItemCategories are used by the ItemSetGroups to allow certain items to be equipped in parallel. It can also be used to split your items in an organized way. An ItemDefinition can be part of multiple categories. Item Categories can be create in the Item Type Manager.

The ID field of the category allows them to be used to determine if the category is unique. The following methods can be used to determine if an item, ItemDefinition, or ItemCategory is part of the specified category

bool containsCategory = m_Category.InherentlyContains(itemCategory);
bool containsDefinition = m_Category.InherentlyContains(itemDefinition);
bool containsItem = m_Category.InherentlyContains(itemIdentifier);

Item Type

ItemTypes are both ItemDefinition and ItemIdentifiers at the same time. This allows for a simplified workflow to setup CharacterItem Prefabs and equipping them. Item Types can be create in the Item Type Manager.

Item Definition

ItemDefinitions are a ScriptableObject that contains the name and prefabs related to the item. It also has a list of categories it is part of.

There must be a main category the definition is part of. This is usually a category created from multiple parent categories, either at edit time or runtime.

The ID field of the ItemDefinition can be used to determine if the ItemDefinition is used. An item can be determined if it is part of an ItemDefinition with:

bool containsCategory = m_ItemDefinition.InherentlyContains(itemIdentifier);

The category can be retried with:

IItemCategoryIdentifier category = m_ItemDefinition.GetItemCategory();

New ItemIdentifiers can be created from an ItemDefinition:

IItemIdentifier item = m_ItemDefinition.CreateItemIdentifier();

Item Identifier

Item Identifiers are an interface for item instances when there can be multiple item references for a single ItemDefinition.

Use custom code or the Ultimate Inventory System to take full advantage of this feature by allowing individual items that share a definition change stats at runtime and persist when exchanging with other characters.
The ID field will be unique for each ItemIdentifier. An ItemIdentifier can be part of a category:
bool partOfCategory = m_ItemIdentifier.InherentlyContainedByCategory(categoryID);

The ItemCategory can be retrieved with:

IItemCategoryIdentifier GetItemCategory();

The ItemDefinition can be retrieved with:

ItemDefinitionBase GetItemDefinition();