It worked yesterday, but after I edited the script it didn’t work. Now I have changed it back, but it still doesn’t work.
Here is the part of my script for the leaderboard that works (the method is called when you get a high score):
using UnityEngine.SocialPlatforms;
using GooglePlayGames;
public void DoLeaderboardPost(int _score)
{
Social.ReportScore(_score, GPGSIds.leaderboard_rush,
(bool success) =>
{
if (success)
{
logText.text = "";
}
else
{
logText.text = "Score failed to post to online leaderboard";
}
});
}
This is the part of the script that controls the 3 leaderboards that don’t work:
using UnityEngine.SocialPlatforms;
using GooglePlayGames;
public void DoLeaderboardPost(int _score)
{
if(taskGoal == 5)
{
Social.ReportScore(_score, GPGSIds.leaderboard_time_trial__5_tasks,
(bool success) =>
{
if (success)
{
logText.text = "";
}
else
{
logText.text = "Score failed to post to online leaderboard";
}
});
}
if (taskGoal == 10)
{
Social.ReportScore(_score, GPGSIds.leaderboard_time_trial__10_tasks,
(bool success) =>
{
if (success)
{
logText.text = "";
}
else
{
logText.text = "Score failed to post to online leaderboard";
}
});
}
if (taskGoal == 20)
{
Social.ReportScore(_score, GPGSIds.leaderboard_time_trial__20_tasks,
(bool success) =>
{
if (success)
{
logText.text = "";
}
else
{
logText.text = "Score failed to post to online leaderboard";
}
});
}
}
In this script, the method is called from this (timerTime is a float):
DoLeaderboardPost((int)(timerTime * 100));