gpt4 book ai didi

android - Social.localUser.Image 在 Unity3d 中返回 null

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:21:36 32 4
gpt4 key购买 nike

我想在 Android 和 IOS 中访问玩家头像,我可以使用 Social Class 获取用户 ID 和用户名,但图像总是返回 null!!

if ( Social.localUser.authenticated && Social.localUser.image != null )
{
Material m = new Material(Shader.Find("Unlit/Transparent Colored"));
m.mainTexture = Social.localUser.image;
AvatarImage.material = m;
}

任何想法。

最佳答案

Social API在 Unity 中仅针对 iOS 实现。

对于 Google Play 服务,我强烈建议购买 prime31 Google Play Game Services Plugin 75 美元。

或者还有一个开源 Play Games Unity Plugin来自 Google,但我不推荐它,因为如果没有登录错误,我无法正确集成它。

更新 1

Social.localUser.imagePlay Games Unity Plugin 的实现总是返回 null。 see PlayGamesUserProfile.cs

关于android - Social.localUser.Image 在 Unity3d 中返回 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25238474/

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