using System.Collections.Generic; using TapTap.Common; using UnityEngine; namespace TapTap.Login { public class Profile { public string name; public string avatar; public string openid; public string unionid; public string email; public bool emailVerified; public Profile(string json) { var dic = Json.Deserialize(json) as Dictionary; name = SafeDictionary.GetValue(dic, "name"); avatar = SafeDictionary.GetValue(dic, "avatar"); openid = SafeDictionary.GetValue(dic, "openid"); unionid = SafeDictionary.GetValue(dic, "unionid"); email = SafeDictionary.GetValue(dic, "email"); emailVerified = SafeDictionary.GetValue(dic, "email_verified"); } public string ToJson() { return JsonUtility.ToJson(this); } } }