예제 #1
0
    IEnumerator Icon_CB()
    {
        WWW       url = new WWW(string.Format("https://graph.facebook.com/{0}/picture?type=small", Player.FBID));
        Texture2D t   = new Texture2D(128, 128);

        yield return(url);

        if (url.error == null)
        {
            url.LoadImageIntoTexture(t);
            MySprite           = IOManager.ChangeTextureToSprite(t);
            Icon_Sprite.sprite = MySprite;
            IOManager.SaveTextureAsPNG(t, string.Format("{0}/{1}", Application.persistentDataPath, Player.FBID));
        }
        else
        {
            GetLocalHostIcon();
        }
    }