Leaderboard Manager

CarterGames.Assets.LeaderboardManager

// Example of usage... replacing "MyMethodHere" with the method you want to call.
LeaderboardManager.MyMethodHere

All methods in class are static and can be accessed by using class name before the method without needing a reference to an instance of the script.

Methods

public void CreateLeaderboard(string id);

Creates a new leaderboard with the id entered and adds it to the leaderboard file for use in your project.

LeaderboardManager.CreateLeaderboard("Level1");
public void DeleteLeaderboard(string id);

Deletes the leaderboard of the id entered. This is an instant action and cannot be undone when called.

LeaderboardManager.DeleteLeaderboard("Level1");
public void ClearLeaderboard(string id);

Clears the leaderboard of the id entered of all entries. This is an instant action and cannot be undone when called.

LeaderboardManager.ClearLeaderboard("Level1");
public bool BoardExists(string id);

Gets whether or not a board of the id entered exists in the system.
Returns bool → Does the board exists, true if it does, false if not.

// If Statement
if (LeaderboardManager.BoardExists("Level1"))
{
    // Do Stuff here
}

// Variable
var _hasBoard = LeaderboardManager.BoardExists("Level1");
public LeaderboardData GetLeaderboard(string id);

Gets the data for the leaderboard of the id entered.
Returns LeaderboardData → The data on the leaderboard requested or null if no data was found.

LeaderboardManager.GetLeaderboard("Level1");
public void AddEntryToBoard(string id, LeaderboardEntry entry);

Adds an entry of the values defined to the board of the defined id.

LeaderboardManager.AddEntryToBoard("Level1", new LeaderboardEntry("John", 100));
public void AddEntryToBoard(string id, string name, string score);

Adds an entry of the values defined to the board of the defined id.

LeaderboardManager.AddEntryToBoard("Level1", "John", 100);
public void AddEntryToBoard(string id, LeaderboardEntry entry);

Removes an entry of the values defined from the board of the defined id.

LeaderboardManager.DeleteEntryFromBoard("Level1", new LeaderboardEntry("John", 100));
public void AddEntryToBoard(string id, string name, string score);

Removes an entry of the values defined from the board of the defined id.

LeaderboardManager.DeleteEntryFromBoard("Level1", "John", 100);
public void Save();

Updates the save file for the leaderboard data with the latest data in the system when called.

LeaderboardManager.Save();
public void Load();

Updates the system with the latest data from the save file for the leaderboard data when called.

LeaderboardManager.Load();