public IEnumerator ContactGravatar(string gravatar, WULGravatarTypes gravatar_type = WULGravatarTypes.Identicon) { string URL = "http://www.gravatar.com/avatar/"+gravatar+"?s=128&d="+ gravatar_type.ToString().ToLower(); WWW w = new WWW(URL); yield return w; Texture2D avatar = null; if (w.error != null) { avatar = new Texture2D(1,1); avatar.SetPixel(0,0, Color.white); avatar.Apply(); } else { avatar= w.texture; } onProfileImageReceived(avatar); }
public void FetchProfileImage(System.Action<Texture2D> response, WULGravatarTypes gravatar_type) { onProfileImageReceived = response; if (null == onProfileImageReceived) return; cmlData data = new cmlData(); data.Set("gravatar_type", gravatar_type.ToString()); WPServer.ContactServer(WULActions.FetchUserEmail.ToString(),login_filepath, LOGINConstant, data, onProfileImageFetched); }