Is there a way to read the number of records in the leaderboard table? Right now I'm loading in batches of 10 since any more than that seems to take a long time (around a half a second per record it seems, on average). I'd like to have a "jump to the bottom of the list" button but I have no way of knowing what that is without guessing or stepping through chunks until the returned records are less than the requested range. I guess that I'm asking for something like this:
Leaderboard leaderboard;
...
int totalCount = leaderboard.length;
Or something similar. Thanks!
You can instantiate a Leaderboard object and read its maxRange property as pages count in the callback of LoadScores, for example:
Leaderboard leaderboard = new Leaderboard(); leaderboard.id = leaderboardID; leaderboard.timeScope = TimeScope.AllTime; leaderboard.range = new Range(page, countPerPage); leaderboard.LoadScores((bool success) => { if (success) Debug.Log("Results in this page: " + leaderboard.scores.Length + " - Number of pages: " + leaderboard.maxRange); });
FRANCESCO CROCETTI @ SKARED CREATIONS
Ah, MaxRange. Perfect, thanks!