【问题标题】:How to add XP points to Google Play Games?如何将 XP 积分添加到 Google Play 游戏?
【发布时间】:2019-02-04 04:08:45
【问题描述】:

为了测试,我添加了两个成就。我有一个名为longScore1的Long变量。我可以保存分数,但是用户没有获得XP。我的目标是给用户XP。 这是我的代码;

  GamesClient gamesClient = Games.getGamesClient(MainActivity.this, GoogleSignIn.getLastSignedInAccount(this));
        gamesClient.setViewForPopups(findViewById(R.id.container_pop_up));

        Games.getAchievementsClient(this, GoogleSignIn.getLastSignedInAccount(this))
                .unlock(getString(R.string.achievement_paaaa));

        longScore1+=80;

【问题讨论】:

    标签: android google-play-services achievements


    【解决方案1】:

    XP 点数作为“成就”处理,并且必须将成就注册到 google play 控制台。

    https://developers.google.com/games/services/common/concepts/achievements#creating_an_achievement

    请参考此 API 文档

    【讨论】:

    • 我知道这个文档。在我阅读了这个文档之后,我添加了两个成就。我不知道代码部分是否有错误。感谢您的帮助。
    猜你喜欢
    • 1970-01-01
    • 2015-07-28
    • 2013-12-03
    • 1970-01-01
    • 1970-01-01
    • 2021-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多