I am getting the user’s avatar from UnityEngine.Social using Google Play Service,
var byteArray = Social.localUser.image.EncodeToPNG();
The avatar is a 2DTexture which I could draw with GUI.DrawTexture(…) using the old style 'Rect’s, but it would be a lot easier and cleaner if I could keep all my UI as gameobjects in nested canvases and have the avatar as a UI.Image.
Is there a possible way to convert a 2DTexture to a UI.Image? I am trying to use ImageConversion.EncodeToPNG() which gives a byte, but have not had any luck making the avatar a UI.Image. Please help!