我遇到了谷歌为Unity3D编辑器提供的Google游戏插件的问题。我刚刚在我的统一项目中包含了这个插件,当我把这个应用程序构建在我的android设备上时,我可以用我的Google帐户在Google游戏中注册。但是,我的成绩从未在线修改,因为Social.ReportProgress方法的回调总是"false“。(愚蠢的成功)
// unlock achievement (achievement ID "Cfjewijawiu_QA")
Social.ReportProgress("Cfjewijawiu_QA", 100.0f, (bool success) => {
// handle success or failure
});我已经检查了我的成就是否使用了正确的身份证。我的代码和Google在github上提供的官方代码之间的区别是百分比。例如,我的应用程序可以用"33.3333“来表示百分比。当我试图用同样的百分比(100.0f)时,bool的成功也是错误的。怎么了?
发布于 2015-01-10 05:31:14
好吧,我发现问题了。
在插件的github存储库上,我将这段代码用于GPG初始化:
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
// enables saving game progress.
.EnableSavedGames()
// registers a callback to handle game invitations received while the game is not running.
.WithInvitationDelegate(this.Debug)
// registers a callback for turn based match notifications received while the
// game is not running.
.WithMatchDelegate(this.Debug)
.Build();
PlayGamesPlatform.InitializeInstance(config);当我在团结课上删除这一节时,成绩报告工作得很好。我想这些台词有些问题,但我不知道在哪里。
此外,我了解到我不能设置像33.333这样的自定义百分比值。锁实现值必须为0.0f,解锁绩效值必须为100.0f。如果您放置的值大于0.0f,则此值将自动被考虑为100.0f。如果要在成就上添加自定义步骤,则必须在Google控制台上使用增量实现。
https://stackoverflow.com/questions/27854575
复制相似问题