示例#1
0
        private void ParseData(JSONObject item)
        {
            var settings  = this.socialModule.GetSettings <FBSettings>();
            var mainPhoto = settings.profileMainPhoto;

            var picture = item.GetField("picture");

            if (picture.isContainer == true)
            {
                picture = picture.GetField("data");
                if (picture.isContainer == true)
                {
                    var url = picture.GetField("url").str;
                    this.photoIsDefault = picture.GetField("is_silhouette").b;
                    SocialSystem.LoadImage(mainPhoto == "photo_50", this.photo_50 = url, (texture, result) => this.photo_50_image = texture as Texture2D, (texture) => this.SetImage(texture as Texture2D));
                }
            }

            var items = item.GetField("devices");

            if (items != null && items.IsArray == true)
            {
                this.devices = new List <UserDevice>();
                foreach (var device in items.list)
                {
                    this.devices.Add(new UserDevice(device));
                }
            }

            this.SetSex(item.GetField("gender").str);
            this.SetUserID(item.GetField("id").str);
            this.SetUserName(item.GetField("name").str);

            this.bdate = item.GetField("birthday").str;

            this.about               = item.GetField("about").str;
            this.bio                 = item.GetField("bio").str;
            this.installed           = item.GetField("installed").b;
            this.is_verified         = item.GetField("is_verified").b;
            this.link                = item.GetField("link").str;
            this.locale              = item.GetField("locale").str;
            this.political           = item.GetField("political").str;
            this.relationship_status = item.GetField("relationship_status").str;
            this.religion            = item.GetField("religion").str;
            this.quotes              = item.GetField("quotes").str;
            this.third_party_id      = item.GetField("third_party_id").str;
            this.timezone            = item.GetField("timezone").f;
            this.token_for_business  = item.GetField("token_for_business").str;
            this.verified            = item.GetField("verified").b;
            this.website             = item.GetField("website").str;

            this.SetAuthenticated(true);
            this.SetState(UnityEngine.SocialPlatforms.UserState.Online);
        }
示例#2
0
        private void ParseData(JSONObject item)
        {
            this.SetSex((int)item.GetField("sex").n);
            this.SetUserID(item.GetField("uid").d.ToString());
            this.SetUserName(string.Format("{0} {1}", item.GetField("first_name").str, item.GetField("last_name").str));

            this.onlineState = (int)item.GetField("online").n;

            this.SetAuthenticated(true);
            this.SetState(UnityEngine.SocialPlatforms.UserState.Online);

            var settings  = this.socialModule.GetSettings <VKSettings>();
            var mainPhoto = settings.profileMainPhoto;

            SocialSystem.LoadImage(mainPhoto == "photo_50", this.photo_50             = item.GetField("photo_50").str, (texture, result) => this.photo_50_image = texture as Texture2D, (texture) => this.SetImage(texture as Texture2D));
            SocialSystem.LoadImage(mainPhoto == "photo_100", this.photo_100           = item.GetField("photo_100").str, (texture, result) => this.photo_100_image = texture as Texture2D, (texture) => this.SetImage(texture as Texture2D));
            SocialSystem.LoadImage(mainPhoto == "photo_200_orig", this.photo_200_orig = item.GetField("photo_200_orig").str, (texture, result) => this.photo_200_orig_image = texture as Texture2D, (texture) => this.SetImage(texture as Texture2D));
            SocialSystem.LoadImage(mainPhoto == "photo_200", this.photo_200           = item.GetField("photo_200").str, (texture, result) => this.photo_200_image = texture as Texture2D, (texture) => this.SetImage(texture as Texture2D));
            SocialSystem.LoadImage(mainPhoto == "photo_400_orig", this.photo_400_orig = item.GetField("photo_400_orig").str, (texture, result) => this.photo_400_orig_image = texture as Texture2D, (texture) => this.SetImage(texture as Texture2D));
            SocialSystem.LoadImage(mainPhoto == "photo_max", this.photo_max           = item.GetField("photo_max").str, (texture, result) => this.photo_max_image = texture as Texture2D, (texture) => this.SetImage(texture as Texture2D));
            SocialSystem.LoadImage(mainPhoto == "photo_max_orig", this.photo_max_orig = item.GetField("photo_max_orig").str, (texture, result) => this.photo_max_orig_image = texture as Texture2D, (texture) => this.SetImage(texture as Texture2D));
        }