コード例 #1
0
 public void GetProfilePic(GetProfilePicCallback callback = null)
 {
     loginAPI.GetProfilePic(delegate(bool result, Texture2D tex)
     {
         callback?.Invoke(result, tex);
     });
 }
コード例 #2
0
    private IEnumerator fetchProfilePic(string url, GetProfilePicCallback callback = null)
    {
        WWW www = new WWW(url);

        yield return(www); //wait until it has downloaded

        if (www.error == null)
        {
            callback?.Invoke(true, www.texture); // return Texture2D
        }
        else
        {
            callback?.Invoke(false, null);
        }
    }
コード例 #3
0
    public override void GetProfilePic(GetProfilePicCallback callback = null)
    {
        FB.API("/me/picture?redirect=false", HttpMethod.GET, delegate(IGraphResult picResult)
        {
            if (String.IsNullOrEmpty(picResult.Error) && !picResult.Cancelled)
            {
                IDictionary data = picResult.ResultDictionary["data"] as IDictionary;
                string photoURL  = data["url"] as String;

                monoScript.StartCoroutine(fetchProfilePic(photoURL, callback));
            }
            else
            {
                callback?.Invoke(false, null);
            }
        });
    }
コード例 #4
0
 public abstract void GetProfilePic(GetProfilePicCallback callback = null);