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
void CreateLeaderboard(string id)
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");
void DeleteLeaderboard(string id)
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");
void ClearLeaderboard(string id)
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");
bool BoardExists(string id)
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");
LeaderboardData GetLeaderboard(string id)
public LeaderboardData GetLeaderboard(string id);
Gets the data for the leaderboard of the id entered.
Returns
ā The data on the leaderboard requested or null if no data was found.LeaderboardData
LeaderboardManager.GetLeaderboard("Level1");
void AddEntryToBoard(string id, LeaderboardEntry entry)
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));
void AddEntryToBoard(string id, string name, string score)
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);
void DeleteEntryFromBoard(string id, LeaderboardEntry entry)
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));
void DeleteEntryFromBoard(string id, string name, string score)
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);
void Save()
public void Save();
Updates the save file for the leaderboard data with the latest data in the system when called.
LeaderboardManager.Save();
void Load()
public void Load();
Updates the system with the latest data from the save file for the leaderboard data when called.
LeaderboardManager.Load();