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
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.
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.
bool partOfCategory = m_ItemIdentifier.InherentlyContainedByCategory(categoryID);
The ItemCategory can be retrieved with:
IItemCategoryIdentifier GetItemCategory();
The ItemDefinition can be retrieved with:
ItemDefinitionBase GetItemDefinition();