android - Social.localUser.Image 在 Unity3d 中返回 null
<p><p>我想在 Android 和 IOS 中访问玩家头像,我可以使用 Social Class 获取用户 ID 和用户名,但图像总是返回 null!!</p>
<pre><code>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;
}
</code></pre>
<p>任何想法。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p><a href="http://docs.unity3d.com/ScriptReference/Social.html" rel="noreferrer noopener nofollow">Social API</a>在 Unity 中仅针对 iOS 实现。</p>
<p>对于 Google Play 服务,我真的推荐购买 <a href="https://prime31.com/docs#androidPlayGameServices" rel="noreferrer noopener nofollow">prime31 Google Play Game Services Plugin</a> 75 美元。</p>
<p>另外还有一个开源 <a href="https://github.com/playgameservices/play-games-plugin-for-unity" rel="noreferrer noopener nofollow">Play Games Unity Plugin</a>来自 Google,但我不能推荐它,因为我无法在没有登录错误的情况下正确集成它。</p>
<p><strong>更新 1</strong></p>
<p><code>Social.localUser.image</code> 的 <a href="https://github.com/playgameservices/play-games-plugin-for-unity" rel="noreferrer noopener nofollow">Play Games Unity Plugin</a> 的实现返回始终为空。 <a href="https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/source/PluginDev/Assets/GooglePlayGames/ISocialPlatform/PlayGamesUserProfile.cs" rel="noreferrer noopener nofollow">see PlayGamesUserProfile.cs</a> </p></p>
<p style="font-size: 20px;">关于android - Social.localUser.Image 在 Unity3d 中返回 null,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/25238474/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/25238474/
</a>
</p>
页:
[1]