Esempio n. 1
0
        private IEnumerator DownloadProfileImageCoroutine(string url, OnGetProfilePicture callback, object cookie)
        {
            WWW wWW = new WWW(url);

            WWWManager.Add(wWW);
            yield return(wWW);

            if (WWWManager.Remove(wWW))
            {
                string error = wWW.error;
                if (string.IsNullOrEmpty(error))
                {
                    callback(wWW.texture, cookie);
                }
                else
                {
                    Service.Logger.ErrorFormat("Error fetching picture at {0}", new object[]
                    {
                        url
                    });
                }
                wWW.Dispose();
            }
            yield break;
        }
Esempio n. 2
0
 public void GetFriendPicture(SocialFriendData friend, OnGetProfilePicture callback, object cookie)
 {
     Service.Engine.StartCoroutine(this.DownloadProfileImageCoroutine(friend.PictureURL, callback, cookie));
 }
Esempio n. 3
0
 public void GetSelfPicture(OnGetProfilePicture callback, object cookie)
 {
     Service.Engine.StartCoroutine(this.DownloadProfileImageCoroutine("https://graph.facebook.com/" + this.FacebookId + "/picture?type=square", callback, cookie));
 }