itemmanager - TogetherGames/Public-Unity-CSharp GitHub Wiki

ItemManager

together.ItemManager

Overview

The ItemManager is used for fetching and finding items that exist for the current game.


Members

List<Item> Items

Stores all the Items contained in the Manager.


Methods


Add()

Adds an Item to the manager internally without persistence.

Note
This method is deprecated

Returns void
Syntax
ItemManager.Add( item )
Parameters

Item item

Instance of an Item to add internally

--------------------------------------------------------------------------------

FindByItemID()

Finds the Item with the specified ItemID if it exists, otherwise returns null.

Returns Item
Syntax
ItemManager.FindByItemID( itemID )
Parameters

long itemID

The ID of the Item to find

--------------------------------------------------------------------------------

GetCount()

Gets the number of Items currently managed internally.

Returns int
Syntax
ItemManager.GetCount(  )

Get()

Gets the Item at the specified index if it exists, otherwise returns null.

Returns Item
Syntax
ItemManager.Get( index )
Parameters

int index

The index of the Item to find

--------------------------------------------------------------------------------

IndexOf()

Returns the index of the specified Item if it exists, otherwise returns -1.

Returns int
Syntax
ItemManager.IndexOf( item )
Parameters

Item item

Instance of the Item to find the index of

--------------------------------------------------------------------------------

IndexOfByItemID()

Returns the index of the Item with the specified ItemID if it exists, otherwise returns -1.

Returns int
Syntax
ItemManager.IndexOfByItemID( itemID )
Parameters

long itemID

The ID of the Item to find the index of

--------------------------------------------------------------------------------

Remove()

Removes an Item from the internally managed list. This does not delete the Item from the game persistently.

Note
This method is deprecated

Returns void
Syntax
ItemManager.Remove( index )
Parameters

int index

The index of the Item to be removed.

--------------------------------------------------------------------------------

GetAll()

Gets all Items configured in the Game. Upon success, this will automatically update the internal list.

Returns void
Syntax
ItemManager.GetAll( callbackFunc )
Parameters

OnCompleteHandler callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------
⚠️ **GitHub.com Fallback** ⚠️