Use Player Leaderboards

Submitting Score

string leaderboardKey = "my_leaderboard";
int score = 1000;

LootLockerSDKManager.SubmitScore("", score, leaderboardKey, (response) =>
{
    if (!response.success) {
        Debug.Log("Could not submit score!");
        Debug.Log(response.errorData.ToString());
        return;
    } 
    Debug.Log("Successfully submitted score!");
   
});

Check out our ref documentation for a more in-depth understanding of the endpoint!

Get Leaderboard Entries

string leaderboardKey = "my_leaderboard";
int count = 50;

LootLockerSDKManager.GetScoreList(leaderboardKey, count, 0, (response) =>
{
    if (!response.success) {
        Debug.Log("Could not get score list!");
        Debug.Log(response.errorData.ToString());
        return;
    } 
    Debug.Log("Successfully got score list!");
});

Check out our ref documentation for a more in-depth understanding of the endpoint!

Get single Entry on Leaderboard

string leaderboardKey = "my_leaderboard";
string memberID = "50";

LootLockerSDKManager.GetMemberRank(leaderboardKey, memberID, (response) =>
{
    if (!response.success) {
        Debug.Log("Could not get the entry!");
        Debug.Log(response.errorData.ToString());
        return;
    } 
    Debug.Log("Successfully got entry!");
});

Last updated