Leaderboards
Creating a Leaderboard
Creating a leaderboard is really easy.
Here you've created a leaderboard named "MyLeaderboard" which is sorted in ascending (highest first) and is number based (high score etc) rather than time based (fastest lap etc).
Getting a Leaderboard
You can safely get a leaderboard with the same function. If you only want to get one that exists you can use:
FindLeaderboardAsync and FindOrCreateLeaderboardAsync return a nullable. If for whatever reason the board cannot be found - it'll be null. This means you should check it first via
leaderboard.HasValue
and then the real leaderboard is in leaderboard.Value
.Submitting a Score
This function will only replace your last score if the new one is better. On success (result.HasValue
) this function will return a Data.LeaderboardUpdate.
You can force your score to be replace, even if it's worse, using: