ios - 有Unity 2019- Social.localUser.id get legacy gamecenterPlayerId吗?

标签 ios iphone unity3d mobile

我一直在将 unity 2017.4 更新到 2019.4 并将我的游戏构建到 ios。 问题是更改 Social.localuser.id 类型,以“G:xxxxx”开头为“T:xxxxxx”。 我搜索了一些研究,发现 Apple 将 player Id gameCenter id 更改为 TeamPlayerId,PlayerId。 我的游戏已上线,要迁移 Apple 的新 ID 类型,至少需要 3 个月使用 gamecenter ID 类型。

-- 1.如何获取遗留的gamecenterid?

API 部分中的 Unity 2020.1.6 发行说明。 “iOS:添加:为旧版 Game Center 玩家 ID 添加了一个公共(public)访问器,让游戏更容易迁移到 iOS 12.4 中的新 ID 类型”。

-- 2. 但我不知道如何获取旧版 Game Center 玩家 ID?

-- 3. 有计划更新 unity 2019 lts 版本以获得传统类型的 Game Center Player Id 吗?

感谢您的阅读。

最佳答案

我不是 100% 确定我是否正确阅读了这个问题,而且我知道这是一个老问题,但我在从 Unity 2018 LTS 转移到 Unity 2019 LTS 时遇到了类似的问题,我相信接受的答案不会'不包括我用来使这一切正常工作的选项。

要获取新的 GameCenter ID,您将在 Unity 2019 LTS 中使用此调用

var gameCenterTeamId = Social.Active.localUser;

要获取旧版 GameCenter ID(之前可以通过上述调用在 Unity 2017/2018 LTS 中访问),您可以使用此调用

var legacyGameCenterID = ((UnityEngine.SocialPlatforms.Impl.UserProfile) Social.localUser).legacyId;

第二次调用的文档是 here . Unity 文档建议您仅将用户迁移到新的 GameCenter Team ID,因为 iOS 已弃用 old GameCenter player id完全。

关于ios - 有Unity 2019- Social.localUser.id get legacy gamecenterPlayerId吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64023829/

相关文章:

iOS 6 : Need to add an image and text to screenshot's footer

ios AVPlayerViewController 无法播放本地 mp4

ios - 将弃用的属性重新分配给新属性 objective-c

unity3d - 从内容中删除/停用子元素后,ScrollRect 在固定规范化位置时无法正确更新位置

c# - 为什么我的单例有两个不同的实例?

ios - swift 2.0 prepareForSegue 不工作

ios - 标记帖子时从 firebase 中删除一个 child

iphone - 创建 block 变量

ios - Collectionview 单元格之间的最大间距

c# - 计算 Minecraft 爆炸