【发布时间】:2016-05-17 06:15:09
【问题描述】:
我制作了这个简单的脚本来将分数发布到 Google Play 排行榜。我知道我输入了排行榜代码是正确的,因为它显示了排行榜的名称。但是,它没有显示 54321 的分数,而是显示“成为第一个上传分数的人!”。这个脚本有什么问题?我花了几个小时在网上寻找,但似乎我做的一切都是正确的!谢谢你
using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
public class PlayGames: MonoBehaviour {
// Use this for initialization
void Start ()
{
PlayGamesPlatform.Activate();
//PlayGamesPlatform.Instance.Authenticate; not working get error CS0201:
//Only assignment, call, inrement, decrement, and new oject expressions can be used as a statement.
//so I'm trying to get this to work with a bool
PlayGamesPlatform.Instance.Authenticate((bool success) => {
//hope this works!
});
if (!PlayGamesPlatform.Instance.localUser.authenticated)
{
return;
}
PlayGamesPlatform.Instance.ReportScore(543210,"Cgglqe3m-mcQAhAI", (bool success) =>
{
if (success)
{
Social.ShowLeaderboardUI();
Debug.Log("log to leaderboard succeeded");
}
else
{
Debug.Log("log to leaderboard failed");
}
});
}
}
【问题讨论】:
标签: c# unity3d scripting google-play-services google-play-games