Remove Item with ID

claudius_I

New member
Hello

I have many uniques items (same class) with diferents id. how can i delete one of them with the id.

" private Opsive.UltimateInventorySystem.Core.Item item;" i have access to the item, but there isn´nt none method to remove the item.

Thanks

Claudio
 
Do you mean removing the item from the InventorySystemManager or from an Inventory?

To remove it from an Inventory you would first get the Item reference from the InventorySystemManager and then use that to remove it from the Inventory.
Code:
var item = InventorySystemManager.GetItem(id);
m_Inventory.RemoveItem(item, 1);

To remove it from the InventorySystemManager use
Code:
InventorySystemManager.ItemRegister.Unregister(id);

Note that unregistering an item from the InventorySystemManager will not remove the item reference from all Inventories. You'll have to do that first
 
When a type doesn't show up in the list you can add it using the UnitOptions window

Go to Tools->Opsive->UnitOptions

Click the Types tab.

Then press the '+' button

and here you can search fo the type you want, in this case "double"

1655276424199.png
You can even make it a "favorite" with a star so that it appears at the top of the search.

All this is detailed in the documentation:
 
Top