Android 排行榜
Leaderboard in Android
遇到了 Google 正确记录所有内容的问题,但它并没有白费,虽然它进入了 google 游戏帐户,之后它稍微考虑了一下并将其发送回游戏.
可能代码有问题。
private string leaderboard = "CgkI9pfnzM8FEAIQAQ";
void Start()
{
PlayGamesPlatform.Activate();
Social.localUser.Authenticate((bool success) => {
if(success)
{
Debug.Log("You have successefully loged in");
}
else
{
Debug.Log("Login failded");
}
});
}
LeaderboardOn()
{
((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(leaderboard);
}
Hightscore()
{
if(score>highscore)
{
PlayerPrefs.SetInt("Highscore", score);
gameOverHighScoreText.GetComponent<Text>().text ="HIGHSCORE:"+score.ToString();
Social.ReportScore(score, leaderboard, (bool success) => {
if (success) print("Successefully added to Leaderboard");
});
}
}
你好 Микита Рєпін
您可以通过以下方式激活 PlayGamesPlatform:
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
其他一切似乎都还好,唯一的问题是
LeaderboardOn()
应该是 void LeaderboardOn()
Highstcore()
应该是 void Highstcore()
遇到了 Google 正确记录所有内容的问题,但它并没有白费,虽然它进入了 google 游戏帐户,之后它稍微考虑了一下并将其发送回游戏.
可能代码有问题。
private string leaderboard = "CgkI9pfnzM8FEAIQAQ";
void Start()
{
PlayGamesPlatform.Activate();
Social.localUser.Authenticate((bool success) => {
if(success)
{
Debug.Log("You have successefully loged in");
}
else
{
Debug.Log("Login failded");
}
});
}
LeaderboardOn()
{
((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(leaderboard);
}
Hightscore()
{
if(score>highscore)
{
PlayerPrefs.SetInt("Highscore", score);
gameOverHighScoreText.GetComponent<Text>().text ="HIGHSCORE:"+score.ToString();
Social.ReportScore(score, leaderboard, (bool success) => {
if (success) print("Successefully added to Leaderboard");
});
}
}
你好 Микита Рєпін
您可以通过以下方式激活 PlayGamesPlatform:
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
其他一切似乎都还好,唯一的问题是
LeaderboardOn()
应该是void LeaderboardOn()
Highstcore()
应该是void Highstcore()