The Item class is the core of the inventory system. Items are simple objects (not a MonoBehavior or Unity Object) which can be unique or shared. The Terminology section explains the differences between the different item objects.

Items are created at runtime and contain attribute values that can be unique to that Item. Even though two Items have the same mold (Item Definition) they can be set to be slightly different. If the Item is part of a mutable Item Category it is even possible to change the values of the Item attributes at runtime.

Items do not have any “item specific logic” attached to it. It is meant to be a simple set of data. Using that data, which consists of the Item Category, Item Definition and Item attributes, the system knows what kind of actions can be performed on them.

Items can be mutable or immutable. Mutable items can be changed at runtime, whereas immutable items cannot be. The Item API contains many useful methods:

// Create an Item from the Inventory System Manager by name.
var potion = InventorySystemManager.CreateItem("Potion");

// If for some reason the item must have a predefined ID set it when you create the item.
var armor = InventorySystemManager.CreateItem("Armor", 777);
// For items to have different IDs they must be either Unique, Mutable or both. This is defined on the Item Category.
var armorIsUnique = armor.IsUnique;
var armorIsMutable = armor.IsMutable;

// Create an Item from the Inventory System Manager by Item Definition.
var swordDefinition = InventorySystemManager.GetItemDefinition("Sword");
var sword = InventorySystemManager.CreateItem(swordDefinition);

// Change an attribute value on the sword item
var attackAttribute = sword.GetAttribute<Attribute<int>>("Attack");
// Get the attribute value
var attack = attackAttribute.GetValue();
// Setting the override value at runtime is only allowed on Mutable Items.
attackAttribute.SetOverrideValue(attack + 5);

// Make a copy of an existing item, copies the attribute values.
var swordCopy = InventorySystemManager.CreateItem(sword);

// Check if the item is part of a category.
var weapon = InventorySystemManager.GetItemCategory("Weapon");
var swordIsWeapon = weapon.InherentlyContains(sword);
// Similar function are available for Item Definition or even between categories.
var weaponIsWeapon = weapon.InherentlyContains(weapon);
var swordDefinitionIsWeapon = weapon.InherentlyContains(swordDefinition);

// Add an item to an inventory by name.
m_Inventory.AddItem("potion", 5);
// Add an item to an inventory by item definition.
m_Inventory.AddItem(swordDefinition, 5);
// Add an item to an inventory or for more control by item Info and item stack.
var itemInfoToAdd = new ItemInfo(sword, 1);
ItemStack itemStackDestination = null;
m_Inventory.AddItem(itemInfoToAdd, itemStackDestination);

// Get all ItemCategories, Item Definitions and Items in the game.
var allItemCategories = InventorySystemManager.ItemCategoryRegister.GetAll();
var allItemDefinitions = InventorySystemManager.ItemDefinitionRegister.GetAll();
var allItems = InventorySystemManager.ItemRegister.GetAll();

//Get all ItemDefinitions of an Item Category
var allMyCategoryItemDefinitions = new ItemDefinition[0];
myCategory.GetAllChildrenElements(ref allMyCategoryItemDefinitions, true);

//Get all items loaded in the system that are part of the ItemCategory (this includes every single instances of items)
foreach (var item in allItems ) {
    if (myCategory.InherentlyContains(item)) {
        //item is part of category