Hello. I must apologice if this question is a bit stupid but i have been fighting a lot and i´m really overflowed.
I am trying to read the max score from the leaderboard "123" and for the user already signed in.
As I read in the manual, the syntax must be:
// Load the best score of leaderboard ID ’123’ for the User object with 1 results per page (to be
attendible ’page’, the limit must be the same as used with LoadScores)
Leaderboard.LoadScoresByUser("123", CombuManager.localUser, eLeaderboardInterval.Total, 1, (Score score,
int page, string error) => {
if (score != null)
Debug.Log("Success: " + score.value + " at page " + page);
else
Debug.Log("Failed: " + error);
});
As LoadScoresByUser is deprecated i changed it to LoadScoreByUser, but i have always the same error with both of them:
No overload for method 'LoadScoreByUser' takes 5 arguments.
When I search in the API documentation, it says:
virtual void Combu.CombuPlatform.LoadScoresByUser | ( | string | leaderboardId, |
User | user, | ||
eLeaderboardInterval | interval, | ||
int | limit, | ||
System.Action< Score, int, string > | callback | ||
) |
But the example is:
It was a bit confusing because I missed to update the API documentation when I deprecated LoadScoresByUser, I have updated the documentation right now.
Basically the method LoadScoreByUser that replaced the old LoadScoresByUser is not a static method but you have to call it from an instanced object of Leaderboard, for example:
Leaderboard leaderboard = new Leaderboard { code = "L123" }; leaderboard.LoadScoreByUser(CombuManager.localUser, eLeaderboardInterval.Total, 10, (Score score, int page, string error) => { if (!string.IsNullOrEmpty(error)) { Debug.LogError("Loading score failed: " + error); } else { // Use score.value (long), score.valueFloat (float) or score.valueDouble (double) // depending on the type of score that you know is stored for this leaderboard Debug.Log(string.Format("New score rank #{0} with value {1} at page {2}", score.rank, score.value, page)); } });
About platform object, the method that you were calling (CombuManager.platform.LoadScores) has a totally different sign (check it in the script CombuPlatform.cs) and it's used to retrieve the scores pages from a leaderboard not depending on a specific user.
FRANCESCO CROCETTI @ SKARED CREATIONS
@skaredcreations Thank you very much. I will try it this afternoon. Many many thanks.
LoadScores appears in the example of LoadScoresByUser in the API documentation. Thats why i finally open this thread. I didn´t know really what to use 🙂
Thank you again for this great asset.