如何获得用户的个人资料图片与Facebook的统一SDK? [英] How to get user's profile picture with Facebook's Unity SDK?

查看:164
本文介绍了如何获得用户的个人资料图片与Facebook的统一SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让使用该游戏的用户的配置文件PIC这一点 -

I'm trying to get the profile pic of the user of the game using this-

void MyPictureCallback(FBResult result) // store user profile pic
{
        if (FB.IsLoggedIn)
        {
            WWW url = new WWW("http" + "://graph.facebook.com/" + FB.UserId + "/picture");

            Texture2D textFb2 = new Texture2D(128, 128, TextureFormat.ARGB32, false); //TextureFormat must be DXT5

            url.LoadImageIntoTexture(textFb2);
            profilePic.renderer.material.mainTexture = textFb2;
        }

但它不工作。我收到没有错误。

But it isn't working. I am getting no errors.

推荐答案

我固定它与本 -

WWW url = new WWW("https" + "://graph.facebook.com/" + userId + "/picture?type=large"); //+ "?access_token=" + FB.AccessToken);

            Texture2D textFb2 = new Texture2D(128, 128, TextureFormat.DXT1, false); //TextureFormat must be DXT5

            yield return url;
            profilePic.renderer.material.mainTexture = textFb2;
            url.LoadImageIntoTexture(textFb2);
            Debug.Log("Working");

这篇关于如何获得用户的个人资料图片与Facebook的统一SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆