Hey guys having an issue with the new FB sdk. Has anyone got an answer for this here is my code. The last line is where my error is anyone know a fix??
void DealWithProfilepic (IGraphResult result){
if (result.Error != null) {
Debug.Log (“ProblemWithProfilePic”);
FB.API (Util.GetPictureURL (“me”, 128, 128), HttpMethod.GET, DealWithProfilepic);
return;
}
Image UserAvatar = UIFBAvatar.GetComponent ();
UserAvatar.sprite = Sprite.Create (result.texture, new Rect (0, 0, 128, 128), new Vector2(0, 0));
The (result.texture is the problem as once i put the result which i need i can’t use texture???
heres my errors
Assets/Resources/Scripts/Fblogs.cs(111,59): error CS1061: Type Facebook.Unity.IGraphResult' does not contain a definition for
Texture’ and no extension method Texture' of type
Facebook.Unity.IGraphResult’ could be found (are you missing a using directive or an assembly reference?)
Assets/Resources/Scripts/Fblogs.cs(111,44): error CS1502: The best overloaded method match for `UnityEngine.Sprite.Create(UnityEngine.Texture2D, UnityEngine.Rect, UnityEngine.Vector2)’ has some invalid arguments
Assets/Resources/Scripts/Fblogs.cs(111,44): error CS1503: Argument #1' cannot convert
object’ expression to type `UnityEngine.Texture2D’
the answer is here Getting Texture from IResult (Facebook Unity SDK 7.0.3b) - Stack Overflow
so you simply patch the SDK a little. It works for me just fine