gpt4 book ai didi

android - 如何将 XP 点数添加到 Google Play 游戏?

转载 作者:行者123 更新时间:2023-11-30 05:06:26 25 4
gpt4 key购买 nike

为了测试目的,我添加了两个成就。我有一个名为 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;

最佳答案

XP 点被视为“成就”,成就必须在 google play 控制台上注册。

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

请引用此API文档

关于android - 如何将 XP 点数添加到 Google Play 游戏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54510032/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com