Exemplo n.º 1
0
    /// <summary>
    /// Raises the update item event.
    /// </summary>
    /// <param name="itemCount">Item count.</param>
    /// <param name="obj">Object.</param>

    public void OnUpdateItem(int itemCount, GameObject obj)
    {
        if (itemCount < 0 || itemCount >= max)
        {
            obj.SetActive(false);
        }
        else
        {
            obj.SetActive(true);
            if (obj.GetComponentInChildren <EazyProfileItem> () != null)
            {
                var item = obj.GetComponentInChildren <EazyProfileItem> ();
                UserDataEntity.Basic searchItem = UserListApi._httpCatchData.result.users.ElementAt(itemCount);
                item.UpdateItem(itemCount, searchItem);
            }
        }
    }
Exemplo n.º 2
0
        /// <summary>
        /// Init this Instance.
        /// </summary>
        public void Init(UserDataEntity.Basic user, UserDataEntity.Basic toUser)
        {
            _toUserId = toUser.id;
            MatchingEventManager.Instance.PanelPopupAnimateMatch(this.gameObject);

            _userName.text   = LocalMsgConst.ME_TEXT;
            _toUserName.text = toUser.name;

            if (string.IsNullOrEmpty(user.profile_image_url) == false)
            {
                StartCoroutine(WwwToRendering(user.profile_image_url, _userProf));
            }

            if (string.IsNullOrEmpty(toUser.profile_image_url) == false)
            {
                StartCoroutine(WwwToRendering(toUser.profile_image_url, _toUserProf));
            }
        }
Exemplo n.º 3
0
    /// <summary>
    /// Updates the item.
    /// </summary>
    /// <param name="count">Count.</param>
    /// <param name="id">Identifier.</param>
    /// <param name="itemName">Item name.</param>
    public void UpdateItem(int count, UserDataEntity.Basic user)
    {
        if (user != null)
        {
            this.gameObject.name = user.id;

            _userName.text = user.name;
            string userNameStr = user.name.Replace("\n", "");

            if (userNameStr.Length > 15)
            {
                _userName.text = userNameStr.Substring(0, 15) + "...";
            }
            else
            {
                _userName.text = userNameStr + "( " + user.age + LocalMsgConst.AGE_TEXT + " )";
            }

            string bodyStr = user.profile.Replace("\n", "");

            if (bodyStr.Length > 15)
            {
                _eazyTitle.text = bodyStr.Substring(0, 15) + "...";
            }
            else
            {
                _eazyTitle.text = bodyStr;
            }

            _dateTime.text  = user.time_ago;
            _userPlace.text = CommonModelHandle.GetPrefDataById(user.pref).name + " " + CommonModelHandle.GetCityDataById(user.city_id).name;
            _read.text      = "";

            if (string.IsNullOrEmpty(user.profile_image_url) == false && _userPict != null)
            {
                StartCoroutine(WwwToRendering(user.profile_image_url, _userPict));
            }
        }
    }
Exemplo n.º 4
0
    /// <summary>
    /// Updates the item.
    /// </summary>
    /// <returns>The item.</returns>
    /// <param name="">.</param>
    //public void UpdateItem (int count, MessageUserListEntity.UserList user)
    public void UpdateItem(int count, UserDataEntity.Basic user = null)
    {
        _userPict.gameObject.name = user.id;
        this.transform.GetComponent <Button> ().onClick.AddListener(NomalClick);

        _titleBg.SetActive(true);
        _prTextBg.SetActive(false);


        //リストの間に広告バナーを導入。
        if (user.is_banner == "1")
        {
            if (CommonConstants.IS_AD_NEND == true)
            {
                _titleBg.SetActive(false);
                _prTextBg.SetActive(true);

                AppStartLoadBalanceManager.m_NendAdClient.LoadNativeAd((INativeAd ad, int code, string message) => {
                    if (null != ad)
                    {
                        _prNendUrl = ad.PromotionUrl;
                        this.transform.GetComponent <Button> ().onClick.RemoveAllListeners();
                        this.transform.GetComponent <Button> ().onClick.AddListener(NendAdClick);

                        // 広告明示のテキストを取得します
                        _read.text  = ad.GetAdvertisingExplicitlyText(AdvertisingExplicitly.AD);
                        _read.color = new Color(128 / 255.0f, 128 / 255.0f, 128 / 255.0f, 255);

                        // 広告見出しを取得します
                        _userName.text = "<size=40>" + ad.ShortText + "</size>";

                        _prText.text = ad.LongText;

                        // 広告画像のTextureをダウンロードします
                        new HTTPRequest(new Uri(ad.AdImageUrl), (request, response) => {
                            if (_userPict != null && response != null)
                            {
                                _userPict.texture = response.DataAsTexture2D;
                            }
                        }).Send();

                        // インプレッションの計測とクリック処理の登録を行います
                        ad.Activate(this.gameObject, _userName.gameObject);
                    }
                    else
                    {
                        Debug.Log("Failed to load ad. code =" + code + ", message = " + message);
                    }
                });
            }
            else
            {
                _addView.SetActive(true);
                _addView.name = user.url;

                new HTTPRequest(new Uri(user.image_url), (request, response) =>
                                _addRawImage.texture = response.DataAsTexture2D).Send();
                return;
            }

            return;
        }

        if (_userName != null)
        {
            string userNameStr = user.name.Replace("\n", "");

            if (userNameStr.Length > 15)
            {
                _userName.text = userNameStr.Substring(0, 15) + "...";
            }
            else
            {
                _userName.text = userNameStr;
            }
        }

        if (_userPlace != null)
        {
            string pref = "";
            string city = "";
            if (string.IsNullOrEmpty(user.pref) == false)
            {
                pref = CommonModelHandle.GetPrefDataById(user.pref).name;
            }

            if (string.IsNullOrEmpty(user.city_id) == false)
            {
                city = CommonModelHandle.GetCityDataById(user.city_id).name;
            }

            string place = string.Format("{0} {1} {2}", user.distance, pref, city);
            _userPlace.text = place;
        }

        if (_eazyTitle != null)
        {
            string bodyStr = user.profile.Replace("\n", "");

            if (bodyStr.Length > 15)
            {
                _eazyTitle.text = bodyStr.Substring(0, 15) + "...";
            }
            else
            {
                _eazyTitle.text = bodyStr;
            }
        }

        if (_dateTime != null)
        {
            _dateTime.text = user.time_ago;
        }

        if (_read != null)
        {
            _read.text = "";            //"未読";
        }

        //プロフ表示。
        if (_userPict != null && string.IsNullOrEmpty(user.profile_image_url) == false)
        {
            if (SearchEventManager.Instance._profTexCaches.ContainsKey(user.profile_image_url) == true)
            {
                _userPict.gameObject.SetActive(true);
                _userPict.texture = SearchEventManager.Instance._profTexCaches[user.profile_image_url];
                return;
            }
            else
            {
                StartCoroutine(WwwToRendering(user.profile_image_url, _userPict));
            }
        }
    }
        /// <summary>
        /// Init this instance.
        /// </summary>
        public void DataInit()
        {
            var user = GetUserApi._httpCatchData.result.user;

            _userDataBasic = user;
            _prefId        = user.pref;
            _cityId        = user.city_id;
            _tall          = user.height;
            _weight        = user.weight;
            _bloodType     = user.blood_type;
            _nickName      = user.name;
            _birthDate     = user.birth_date;
            _profile       = user.profile;

            if (user.body_type != null)
            {
                _bodyType = user.body_type;
            }
            else
            {
                _bodyType.Add("");
            }

            if (user.hair_style != null)
            {
                _hairStyle = user.hair_style;
            }
            else
            {
                _hairStyle.Add("");
            }

            if (user.glasses != null)
            {
                _glasses = user.glasses;
            }
            else
            {
                _glasses.Add("");
            }

            if (user.type != null)
            {
                _type = user.type;       //TODO: 複数選択可・対応
            }
            else
            {
                _type.Add("");
            }

            if (user.personality != null)
            {
                _personality = user.personality;//TODO: 複数選択可・対応
            }
            else
            {
                _personality.Add("");
            }

            if (user.holiday != null)
            {
                _holiday = user.holiday;
            }
            else
            {
                _holiday.Add("");
            }

            if (user.annual_income != null)
            {
                _annualIncome = user.annual_income;
            }
            else
            {
                _annualIncome.Add("");
            }

            if (user.education != null)
            {
                _education = user.education;
            }
            else
            {
                _education.Add("");
            }

            if (user.housemate != null)
            {
                _housemate = user.housemate;
            }
            else
            {
                _housemate.Add("");
            }

            if (user.sibling != null)
            {
                _sibling = user.sibling;
            }
            else
            {
                _sibling.Add("");
            }

            if (user.alcohol != null)
            {
                _alcohol = user.alcohol;
            }
            else
            {
                _alcohol.Add("");
            }

            if (user.tobacco != null)
            {
                _tobacco = user.tobacco;
            }
            else
            {
                _tobacco.Add("");
            }

            if (user.car != null)
            {
                _car = user.car;
            }
            else
            {
                _car.Add("");
            }

            if (user.pet != null)
            {
                _pet = user.pet;
            }
            else
            {
                _pet.Add("");
            }

            if (user.hobby != null)
            {
                _hobby = user.hobby;
            }
            else
            {
                _hobby.Add("");
            }

            if (user.interest != null)
            {
                _interest = user.interest;
            }
            else
            {
                _interest.Add("");
            }

            if (user.marital != null)
            {
                _marital = user.marital;
            }
            else
            {
                _marital.Add("");
            }
        }
Exemplo n.º 6
0
        // すでに通信しなくてもデータあるからこれで初期化してって場合  常に通信かかっても更新しなおしたほうがいいのかもしれない・・・
        public void InitFromAlreadyData(UserDataEntity.Basic user)
        {
            string isFavorite = user.is_favorite;
            string isBlock    = user.is_block;

            if (isBlock == "true")
            {
                _blockButton.GetChild(0).gameObject.SetActive(true);
            }
            else if (isBlock == "false")
            {
                _blockButton.GetChild(0).gameObject.SetActive(false);
            }

            if (isFavorite == "true")
            {
                _favoriteButton.GetChild(0).gameObject.SetActive(true);
            }
            else if (isFavorite == "false")
            {
                _favoriteButton.GetChild(0).gameObject.SetActive(false);
            }

            string islimitrelease = user.is_limit_release;

            if (islimitrelease == "true")
            {
                _LimitMessageButton.GetComponent <Button> ().enabled = false;
                _LimitMessageButton.GetComponent <Image> ().color    = new Color(147 / 255.0f, 147 / 255.0f, 147 / 255.0f, 255);
            }
            else if (islimitrelease == "false")
            {
                _LimitMessageButton.GetComponent <Image> ().color    = new Color(247 / 255.0f, 117 / 255.0f, 133 / 255.0f, 255);
                _LimitMessageButton.GetComponent <Button> ().enabled = true;
            }

            if (user != null)
            {
                Debug.Log("user情報がヌルです");
            }

            if (string.IsNullOrEmpty(user.profile_image_url) == false && _profImage != null)
            {
                StartCoroutine(WwwToRendering(user.profile_image_url, _profImage));
            }
            else
            {
                _profImage.texture = Resources.Load("Texture/noimage_user") as Texture;
            }

            if (string.IsNullOrEmpty(user.cover_image_url) == false && _coverImage != null)
            {
                StartCoroutine(WwwToRendering(user.cover_image_url, _coverImage));
            }
            else
            {
                _coverImage.texture = Resources.Load("Texture/noimage_cover") as Texture;
            }

            if (_name != null)
            {
                _name.text = user.name;
            }

            if (_sex_cd != null)
            {
                if (user.sex_cd == ((int)GenderType.FeMale).ToString())
                {
                    _sex_cd.text = LocalMsgConst.GENDER_FEMALE;
                }
                else if (user.sex_cd == ((int)GenderType.Male).ToString())
                {
                    _sex_cd.text = LocalMsgConst.GENDER_MALE;
                }
            }

            if (_blood_type != null)
            {
                string bloodText = user.blood_type;

                if (bloodText == "0")
                {
                    _blood_type.text = "秘密";
                }
                else
                {
                    string bloodTypeMsg = CommonModelHandle.GetByIdBaseData(user.blood_type, CurrentProfSettingStateType.BloodType).name;
                    _blood_type.text = bloodTypeMsg + LocalMsgConst.BLOOD_TYPE_JA;
                }
            }


            if (_prefAndCity != null)
            {
                string prefName = CommonModelHandle.GetPrefDataById(user.pref).name;
                string cityName = CommonModelHandle.GetCityDataById(user.city_id).name;

                _prefAndCity.text = prefName + "" + cityName;
            }

            if (_birth_date != null)
            {
                if (user.age == "0")
                {
                    _birth_date.text = "秘密";
                }
                else
                {
                    _birth_date.text = user.age + "歳";
                }
            }

            if (_height != null)
            {
                if (user.height == "0")
                {
                    _height.text = "秘密";
                }
                else
                {
                    _height.text = user.height + "cm";
                }
            }

            if (_weight != null)
            {
                if (user.weight == "0")
                {
                    _weight.text = "秘密";
                }
                else
                {
                    _weight.text = user.weight + "kg";
                }
            }


            if (_profile != null)
            {
                _profile.text = user.profile;
            }

            if (_body_type != null)
            {
                _body_type.text = user.body_type[0];
            }

            if (_hair_style != null)
            {
                _hair_style.text = user.hair_style[0];
            }

            if (_glasses != null)
            {
                _glasses.text = user.glasses[0];
            }

            if (_type != null)
            {
                _type.text = user.type[0];
            }

            if (_personality != null)
            {
                _personality.text = user.personality[0];
            }

            if (_holiday != null)
            {
                _holiday.text = user.holiday[0];
            }

            if (_annual_income)
            {
                _annual_income.text = user.annual_income[0];
            }

            if (_education != null)
            {
                _education.text = user.education[0];
            }

            if (_housemate != null)
            {
                _housemate.text = user.housemate[0];
            }

            if (_sibling != null)
            {
                _sibling.text = user.sibling[0];
            }

            if (_alcohol != null)
            {
                _alcohol.text = user.alcohol[0];
            }

            if (_tobacco != null)
            {
                _tobacco.text = user.tobacco[0];
            }

            if (_car != null)
            {
                _car.text = user.car[0];
            }

            if (_pet != null)
            {
                _pet.text = user.pet[0];
            }

            if (_hobby != null)
            {
                _hobby.text = user.hobby[0];
            }

            if (_interest != null)
            {
                _interest.text = user.interest[0];
            }

            if (_marital != null)
            {
                _marital.text = user.marital[0];
            }


            _headerTitle.GetComponent <Text> ().text = GetUserApi._httpOtherUserCatchData.name;
        }
    /// <summary>
    /// Updates the item.
    /// </summary>
    /// <returns>The item.</returns>
    /// <param name="">.</param>
    /// public void UpdateItem (int count, MessageUserListEntity.UserList user)
    public void UpdateItem(int count, UserDataEntity.Basic user_1, UserDataEntity.Basic user_2, UserDataEntity.Basic user_3, UserDataEntity.Basic user_4, bool userenable, bool userenable2, bool userenable3, bool userenable4)
    {
        // ユーザーid記憶
        _userPict.gameObject.name  = user_1.id;
        _userPict2.gameObject.name = user_2.id;
        _userPict3.gameObject.name = user_3.id;
        _userPict4.gameObject.name = user_4.id;


        if (_userPict != null && string.IsNullOrEmpty(user_1.profile_image_url) == false)
        {
            StartCoroutine(WwwToRendering(user_1.profile_image_url, _userPict));
        }

        if (_userPict != null && string.IsNullOrEmpty(user_2.profile_image_url) == false)
        {
            StartCoroutine(WwwToRendering(user_2.profile_image_url, _userPict2));
        }

        if (_userPict != null && string.IsNullOrEmpty(user_3.profile_image_url) == false)
        {
            StartCoroutine(WwwToRendering(user_3.profile_image_url, _userPict3));
        }

        if (_userPict != null && string.IsNullOrEmpty(user_4.profile_image_url) == false)
        {
            StartCoroutine(WwwToRendering(user_4.profile_image_url, _userPict4));
        }

        if (_userPrefAndAge_1 != null)
        {
            _userPrefAndAge_1.text = CommonModelHandle.GetPrefDataById(user_1.pref).name + " (" + user_1.age + LocalMsgConst.AGE_TEXT + ") ";
        }

        if (_userPrefAndAge_2 != null)
        {
            _userPrefAndAge_2.text = CommonModelHandle.GetPrefDataById(user_2.pref).name + " (" + user_2.age + LocalMsgConst.AGE_TEXT + ") ";
        }

        if (_userPrefAndAge_3 != null)
        {
            _userPrefAndAge_3.text = CommonModelHandle.GetPrefDataById(user_3.pref).name + " (" + user_3.age + LocalMsgConst.AGE_TEXT + ") ";
        }

        if (_userPrefAndAge_4 != null)
        {
            _userPrefAndAge_4.text = CommonModelHandle.GetPrefDataById(user_4.pref).name + " (" + user_3.age + LocalMsgConst.AGE_TEXT + ") ";
        }



        _userPict.enabled  = userenable;
        _userPict2.enabled = userenable2;
        _userPict3.enabled = userenable3;
        _userPict4.enabled = userenable4;
    }