Inventory System

Inventory system represents a very simple, and light inventory, created to demonstrate basic actions, like Adding, Deleting, and Checking items.

For sample, you can see PickUpInteractable script, which is placed on item that will be added in inventory later. PickUpInteractable has a field for inventoryItemData, that contains basic data for item, like id, public name, and icon.

So, adding item to inventory is done by only calling a single method:

InventoryItemData inventoryItemData;

public override void OnInteractPrimary()
{
    InventoryController.AddToInventory(inventoryItemData);
    .....
}

Like this, you can call

InventoryController.HasInInventory(inventoryItemData)

or

InventoryController.DeleteFromInventory(inventoryItemData)

Last updated