Get scores for a certain tier

This method fails when your leaderboard is not configured with tiers. When you retrieve scores by tier, the returned LeaderboardEntry response tiers are contextual to the rank. For example, if a rank named Silver starts at rank 100 and a player’s global rank is 101, their rank within the Silver tier is 1.

Get the scores for a certain tier with the GetScoresByTierAsync method. By default this method returns the top 10 scores from the specified tier:

C#

public async void GetScoresByTier()
{
    var scoresResponse = await LeaderboardsService.Instance
        .GetScoresByTierAsync(leaderboardId, "silver");
    Debug.Log(JsonConvert.SerializeObject(scoresResponse));
}

Paginated access to all scores within the tier is available by specifying the optional GetScoresByTierOptions object with the optional Offset and Limit pagination arguments. Offsetis the number of entries to skip when retrieving the leaderboard scores and defaults to 0. Limit is the number of leaderboard scores to return and defaults to 10.

C#

public async void GetPaginatedScoresByTier()
{
    var scoresResponse = await LeaderboardsService.Instance.GetScoresByTierAsync(
        leaderboardId,
        "silver",
        new GetScoresByTierOptions{ Offset = 25, Limit = 50 }
    );
    Debug.Log(JsonConvert.SerializeObject(scoresResponse));
}

To get the score with any associated metadata, use the IncludeMetadata option in the GetScoresByTierOptions configuration object:

C#

public async void GetScoresByTierWithMetadata()
{
    var scoreResponse = await LeaderboardsService.Instance
        .GetScoresByTierAsync(
            leaderboardId,
            "silver",
            new GetScoresByTierOptions { IncludeMetadata = true });
    Debug.Log(JsonConvert.SerializeObject(scoreResponse));
}

Metadata is not retrieved by default.

For methods that retrieve scores: if your player has not submitted a score and the leaderboard is bucketed, the player is not assigned a bucket. A failed score retrieval returns an error that has its Reason field set to ScoreSubmissionRequired.