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; }
public void GetFriendPicture(SocialFriendData friend, OnGetProfilePicture callback, object cookie) { Service.Engine.StartCoroutine(this.DownloadProfileImageCoroutine(friend.PictureURL, callback, cookie)); }
public void GetSelfPicture(OnGetProfilePicture callback, object cookie) { Service.Engine.StartCoroutine(this.DownloadProfileImageCoroutine("https://graph.facebook.com/" + this.FacebookId + "/picture?type=square", callback, cookie)); }