leaderboardmanager - TogetherGames/Public-Unity-CSharp GitHub Wiki

LeaderboardManager

together.LeaderboardManager

Overview

The LeaderboardManager is used for fetching and finding leaderboards that exist for the current game.


Members

List<Leaderboard> Leaderboards

Stores all the Leaderboards contained in the Manager.


Methods


Add()

Adds a Leaderboard to the internally managed list without persistence.

Note
This method is deprecated

Returns void
Syntax
LeaderboardManager.Add( leaderboard )
Parameters

Leaderboard leaderboard

Instance of a Leaderboard to add internally

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

FindByLeaderboardID()

Finds the Leaderboard with the specified LeaderboardID if it exists, otherwise returns null

Returns Leaderboard
Syntax
LeaderboardManager.FindByLeaderboardID( leaderboardID )
Parameters

long leaderboardID

The ID of the Leaderboard to find

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

GetCount()

Gets the number of Leaderboards currently managed internally.

Returns int
Syntax
LeaderboardManager.GetCount(  )

Get()

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

Returns Leaderboard
Syntax
LeaderboardManager.Get( index )
Parameters

int index

The index of the Leaderboard to find

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

IndexOf()

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

Returns int
Syntax
LeaderboardManager.IndexOf( leaderboard )
Parameters

Leaderboard leaderboard

Instance of the Leaderboard to find the index of

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

IndexOfByLeaderboardID()

Returns the index of the Leaderboard with the specified LeaderboardID if it exists, otherwise returns -1.

Returns int
Syntax
LeaderboardManager.IndexOfByLeaderboardID( leaderboardID )
Parameters

long leaderboardID

The ID of the Leaderboard to find the index of

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

Remove()

Removes a Leaderboard from the internally managed list. This does not delete the leaderboard from the game persistently.

Note
This method is deprecated

Returns void
Syntax
LeaderboardManager.Remove( index )
Parameters

int index

The index of the Leaderboard to be removed

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

Delete()

Deletes a Leaderboard. Upon success, this will automatically update the internal list.

Returns void
Syntax
LeaderboardManager.Delete( leaderboardID, callbackFunc )
Parameters

long leaderboardID

The ID of the Leaderboard to delete

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion

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

GetAll()

Gets all Leaderboards for the current session's Game or a particular User.

Returns void
Syntax
LeaderboardManager.GetAll( getForUserID, callbackFunc )
Parameters

long getForUserID

The ID of the User to retrieve Leaderboards for. Pass 0 to fetch all Leaderboards.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

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