Use Metadata to Store Additional Information
In this scenario, the player has had the opportunity to write / select their country to be displayed on the Leaderboard.
string leaderboardKey = "my_leaderboard";
int score = 1000;
string metadata = "country:" + PlayerPrefs.GetString("PlayerAssignedCountry"); // Replace PlayerPrefs.GetString("PlayerAssignedCountry") with an existing way of getting the configured country for the player in your game
LootLockerSDKManager.SubmitScore("", score, leaderboardKey, metadata, (response) =>
{
if (!response.success) {
Debug.Log("Could not submit score!");
Debug.Log(response.errorData.ToString());
return;
}
Debug.Log("Successfully submitted score!\n with metadata: " + metadata);
});
Last updated