OGeek|极客世界-中国程序员成长平台

标题: android - Social.localUser.Image 在 Unity3d 中返回 null [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 00:40
标题: android - Social.localUser.Image 在 Unity3d 中返回 null

我想在 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;
}

任何想法。



Best Answer-推荐答案


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 的实现返回始终为空。 see PlayGamesUserProfile.cs

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






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4