/// <summary>
        /// Categories the changed.
        /// </summary>
        /// <param name="result">Result.</param>
        public void CategoryChanged(int result)
        {
            string name = _boradCategoryList[_boardCategory.value];
            var    d    = CommonModelHandle.GetByNameBaseData(name, CurrentProfSettingStateType.BoardCategory);

            _category = d.id;
        }
        private IEnumerator InitWait()
        {
            _loadingOverlay.SetActive(true);

            while (InitDataApi._httpCatchData == null)
            {
                yield return(InitDataApi._httpCatchData != null);
            }

            //フィールドセット処理。
            if (InitDataApi._httpCatchData.result.board_category.Count > 0)
            {
                _boradCategoryList.Clear();
                foreach (var category in InitDataApi._httpCatchData.result.board_category)
                {
                    //Debug.Log (category.id);
                    //Debug.Log (category.name);
                    _boradCategoryList.Add(category.name);
                }

                _boardCategory.ClearOptions();
                _boardCategory.options.Clear();
                _boardCategory.AddOptions(_boradCategoryList);
            }
            _loadingOverlay.SetActive(false);

            // カテゴリー初期化
            string name = _boradCategoryList[_boardCategory.value];
            var    d    = CommonModelHandle.GetByNameBaseData(name, CurrentProfSettingStateType.BoardCategory);

            _category = d.id;
        }
        /// <summary>
        /// Genders the changed.
        /// </summary>
        /// <param name="result">Result.</param>
        public void GenderChanged(int result)
        {
            string name = _genderList[_genderDropdown.value];

            Debug.Log(name + " どっちに送られてます? ");
            var d = CommonModelHandle.GetByNameBaseData(name, CurrentProfSettingStateType.Gender);

            _gender = d.id;
        }
    /// <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;
    }
Beispiel #5
0
        /// <summary>
        /// Genders the changed.
        /// 性別選択。
        /// </summary>
        /// <returns>The changed.</returns>
        public void GenderChanged()
        {
            string n = _genderList[_gender.value];
            var    d = CommonModelHandle.GetByNameBaseData(n, CurrentProfSettingStateType.Gender);

            _sexAPIThrow = d.id;


            Debug.Log("サーバーに送るデータが取得出来ているか? Gender " + _sexAPIThrow);
        }
Beispiel #6
0
        /// <summary>
        /// Categories the changed.
        /// カテゴリのやつ。
        /// </summary>
        /// <returns>The changed.</returns>
        public void CategoryChanged()
        {
            if (_category.value != 0)
            {
                string n = _categoryList[_category.value];
                var    d = CommonModelHandle.GetByNameBaseData(n, CurrentProfSettingStateType.BoardCategory);
                _categoryAPIThrow = d.id;
            }
            else if (_category.value == 0)
            {
                _categoryAPIThrow = "";
            }

            Debug.Log("サーバーに送るデータが取得出来ているか? Category " + _categoryAPIThrow);
        }
Beispiel #7
0
        /// <summary>
        /// Radiuses the changed.
        /// 距離データ取得
        /// </summary>
        /// <returns>The changed.</returns>
        public void RadiusChanged()
        {
            if (_radius.value != 0)
            {
                string n = _radiusList [_radius.value];
                var    d = CommonModelHandle.GetByNameBaseData(n, CurrentProfSettingStateType.Radius);
                _radiusAPIThrow = d.id;
            }
            else if (_radius.value == 0)
            {
                _radiusAPIThrow = "";
            }

            Debug.Log("サーバーに送るデータが取得出来ているか? Radius " + _radiusAPIThrow);
        }
Beispiel #8
0
        /// <summary>
        /// Orders the changed.
        /// 表示順のやつ
        /// </summary>
        /// <returns>The changed.</returns>
        public void OrderChanged()
        {
            if (_order.value != 0)
            {
                string n = _orderList[_order.value];
                var    d = CommonModelHandle.GetByNameBaseData(n, CurrentProfSettingStateType.UserSort);
                _orderAPIThrow = d.id;
            }
            else if (_order.value == 0)
            {
                _orderAPIThrow = "1";
            }

            Debug.Log("サーバーに送るデータが取得出来ているか? Order " + _orderAPIThrow);
        }
    /// <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));
            }
        }
    }
        /// <summary>
        /// Sets the data.
        /// 登録する用にセット。
        /// </summary>
        /// <returns>The data.</returns>
        public void SetData()
        {
            string prefId = "";
            string cityId = "";

            prefId             = _prefId;
            cityId             = _cityId;
            _userData.user_key = AppStartLoadBalanceManager._userKey;
            _userData.pref     = prefId;
            _userData.city_id  = cityId;
            _userData.name     = _nickName.GetComponent <InputField> ().text;

#if UNITY_EDITOR
            string birthDate = "";
            if (
                string.IsNullOrEmpty(_dropdownYear.GetComponentInChildren <Text> ().text) == false &&
                string.IsNullOrEmpty(_dropdownMonth.GetComponentInChildren <Text> ().text) == false &&
                string.IsNullOrEmpty(_dropdownDays.GetComponentInChildren <Text> ().text) == false
                )
            {
                birthDate = _dropdownYear.GetComponentInChildren <Text> ().text + "-" + _dropdownMonth.GetComponentInChildren <Text> ().text + "-" + _dropdownDays.GetComponentInChildren <Text> ().text;
            }
            _userData.birth_date = birthDate;
#endif
            _userData.sex_cd = AppStartLoadBalanceManager._gender;

            if (string.IsNullOrEmpty(CommonModelHandle.GetPrefDataById(prefId).name) == false)
            {
                _pref.text = CommonModelHandle.GetPrefDataById(prefId).name;
            }

            if (string.IsNullOrEmpty(CommonModelHandle.GetCityDataById(cityId).name) == false)
            {
                _city.text = CommonModelHandle.GetCityDataById(cityId).name;
            }
        }
Beispiel #11
0
        /// <summary>
        /// Natives the picker button.
        /// ネイティブピッカー用のボタン処理。
        /// </summary>
        /// <returns>The picker button.</returns>
        /// <param name="stateType">State type.</param>
        public void NativePickerButton(string state)
        {
            SearchConditionType stateType = (SearchConditionType)System.Enum.Parse(typeof(SearchConditionType), state);

            string []     itemList = { "" };
            List <string> list     = new List <string> ();

#if UNITY_IOS
            list.Add("");
#endif
            switch (stateType)
            {
            case SearchConditionType.Order:
                var order = CommonModelHandle.GetNameMaster(CurrentProfSettingStateType.UserSort);
                foreach (var o in order)
                {
                    list.Add(o.name);
                }
                break;

            case SearchConditionType.Gender:
                list.Add("指定しない");
                list.Add("女性");
                list.Add("男性");
                break;

            case SearchConditionType.AgeHigh:
            case SearchConditionType.AgeLow:
                for (int i = 18; i <= 100; i++)
                {
                    list.Add(i.ToString());
                }
                break;

            case SearchConditionType.TallHigh:
            case SearchConditionType.TallLow:
                for (int i = 110; i <= 220; i++)
                {
                    list.Add(i.ToString());
                }
                break;

            case SearchConditionType.BodyType:
                var bodyType = CommonModelHandle.GetNameMaster(AppStartLoadBalanceManager._gender, CurrentProfSettingStateType.BodyType);
                list.Add("指定しない");
                foreach (var b in bodyType)
                {
                    list.Add(b.name);
                }
                break;

            case SearchConditionType.IsImage:
                list.Add("指定しない");
                list.Add("画像なし");
                list.Add("画像あり");
                break;

            case SearchConditionType.Radius:
                list.Add("指定しない");
                foreach (var radius in InitDataApi._httpCatchData.result.radius)
                {
                    list.Add(radius.name);
                }
                break;
            }

            if (list.Count > 0)
            {
                itemList = list.ToArray();

                NativePicker.Instance.ShowCustomPicker(toScreenRect(_drawRect), itemList, 0, (long val) => {
                    for (int i = 0; i < list.Count; i++)
                    {
                        if ((int)val == i)
                        {
                            DisplayDataSet(stateType, i, list[i]);
                            break;
                        }
                    }
                    Debug.Log("ピッカーの値。 " + val);
                }, () => {
                    Debug.Log("ピッカーをキャンセルにした場合。");
                });
            }
        }
Beispiel #12
0
        /// <summary>
        /// Naitives the init coroutine.
        /// </summary>
        /// <returns>The init coroutine.</returns>
        private IEnumerator NaitiveInitCoroutine()
        {
            string _commonFileName = LocalFileConstants.GetLocalFileDir() + LocalFileConstants.COMMON_LOCAL_FILE_NAME;

            LocalFileHandler.Init(_commonFileName);
            /// ファイルが作成されるまでポーリングして処理待ち
            while (System.IO.File.Exists(_commonFileName) == false)
            {
                yield return(System.IO.File.Exists(_commonFileName) == true);
            }
            /// 検索条件をローカルに保存しているので、そこから引いてくる。
            SearchEventManager.SearchCondition SearchCondition = LocalFileHandler.Load <SearchEventManager.SearchCondition> (LocalFileConstants.SEARCH_CONDITION_KEY);

            /// ローカルに「距離順, 最終ログイン順,登録日が新しい順」のデータが保存されている場合の処理。
            if (string.IsNullOrEmpty(SearchCondition._order) == false)
            {
                _orderNative.transform.GetChild(0).gameObject.SetActive(false);
                _orderNative.transform.GetChild(1).gameObject.SetActive(true);
                var oderText = CommonModelHandle.GetByIdBaseData(SearchCondition._order, CurrentProfSettingStateType.UserSort);

                if (oderText != null)
                {
                    _orderNative.transform.GetChild(1).GetComponent <Text> ().text = oderText.name;
                    _orderAPIThrow = oderText.id;
                }
                else
                {
                    _orderNative.transform.GetChild(1).GetComponent <Text> ().text = "距離順が近い";
                    _orderAPIThrow = "1";
                }
            }
            else
            {
                _orderNative.transform.GetChild(0).gameObject.SetActive(false);
                _orderNative.transform.GetChild(1).gameObject.SetActive(true);
                _orderNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                _orderAPIThrow = "1";
            }
            /// 性別の条件の場合の処理
            if (string.IsNullOrEmpty(SearchCondition._sex) == false)
            {
                _genderNative.transform.GetChild(0).gameObject.SetActive(false);
                _genderNative.transform.GetChild(1).gameObject.SetActive(true);

                var genderText = CommonModelHandle.GetByIdBaseData(SearchCondition._sex, CurrentProfSettingStateType.Gender);

                if (genderText != null)
                {
                    _genderNative.transform.GetChild(1).GetComponent <Text> ().text = genderText.name;
                    _sexAPIThrow = genderText.id;
                }
                else
                {
                    _genderNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                    _sexAPIThrow = "";
                }
            }
            else
            {
                _genderNative.transform.GetChild(0).gameObject.SetActive(false);
                _genderNative.transform.GetChild(1).gameObject.SetActive(true);
                _genderNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                _sexAPIThrow = "";
            }

            /// 年齢のまでの場合の処理。
            if (string.IsNullOrEmpty(SearchCondition._ageTo) == false)
            {
                _ageToNative.transform.GetChild(0).gameObject.SetActive(false);
                _ageToNative.transform.GetChild(1).gameObject.SetActive(true);
                _ageToNative.transform.GetChild(1).GetComponent <Text> ().text = SearchCondition._ageTo;
                _ageHighAPIThrow = SearchCondition._ageTo;
            }
            else
            {
                _ageToNative.transform.GetChild(0).gameObject.SetActive(false);
                _ageToNative.transform.GetChild(1).gameObject.SetActive(true);
                _ageToNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                _ageHighAPIThrow = "";
            }

            /// 年齢の〜からの場合の処理
            if (string.IsNullOrEmpty(SearchCondition._ageFrom) == false)
            {
                _ageFromNative.transform.GetChild(0).gameObject.SetActive(false);
                _ageFromNative.transform.GetChild(1).gameObject.SetActive(true);
                _ageFromNative.transform.GetChild(1).GetComponent <Text> ().text = SearchCondition._ageFrom;
                _ageLowAPIThrow = SearchCondition._ageFrom;
            }
            else
            {
                _ageFromNative.transform.GetChild(0).gameObject.SetActive(false);
                _ageFromNative.transform.GetChild(1).gameObject.SetActive(true);
                _ageFromNative.transform.GetChild(1).GetComponent <Text> ().text = "";
                _ageLowAPIThrow = "";
            }

            /// 身長のまでの場合の処理。
            if (string.IsNullOrEmpty(SearchCondition._heightTo) == false)
            {
                _heightToNative.transform.GetChild(0).gameObject.SetActive(false);
                _heightToNative.transform.GetChild(1).gameObject.SetActive(true);
                _heightToNative.transform.GetChild(1).GetComponent <Text> ().text = SearchCondition._heightTo;
                _heightToAPIThrow = SearchCondition._heightTo;
            }
            else
            {
                _heightToNative.transform.GetChild(0).gameObject.SetActive(false);
                _heightToNative.transform.GetChild(1).gameObject.SetActive(true);
                _heightToNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                _heightToAPIThrow = "";
            }

            /// 身長の〜からの場合の処理。
            if (string.IsNullOrEmpty(SearchCondition._heightFrom) == false)
            {
                _heightFromNative.transform.GetChild(0).gameObject.SetActive(false);
                _heightFromNative.transform.GetChild(1).gameObject.SetActive(true);
                _heightFromNative.transform.GetChild(1).GetComponent <Text> ().text = SearchCondition._heightFrom;
                _heightFromAPIThrow = SearchCondition._heightFrom;
            }
            else
            {
                _heightFromNative.transform.GetChild(0).gameObject.SetActive(false);
                _heightFromNative.transform.GetChild(1).gameObject.SetActive(true);
                _heightFromNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                _heightFromAPIThrow = "";
            }

            /// 体型の条件の場合の初期化処理
            if (string.IsNullOrEmpty(SearchCondition._bodyType) == false)
            {
                _bodyTypeNative.transform.GetChild(0).gameObject.SetActive(false);
                _bodyTypeNative.transform.GetChild(1).gameObject.SetActive(true);
                _bodyTypeNative.transform.GetChild(1).GetComponent <Text> ().text = SearchCondition._bodyType;
                _bodyTypeAPIThrow = SearchCondition._bodyType;
            }
            else
            {
                _bodyTypeNative.transform.GetChild(0).gameObject.SetActive(false);
                _bodyTypeNative.transform.GetChild(1).gameObject.SetActive(true);
                _bodyTypeNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                _bodyTypeAPIThrow = "";
            }

            ///// 画像あり、なしの条件の場合の処理
            if (string.IsNullOrEmpty(SearchCondition._isImage) == false)
            {
                _isImageNative.transform.GetChild(0).gameObject.SetActive(false);
                _isImageNative.transform.GetChild(1).gameObject.SetActive(true);

                if (SearchCondition._isImage == "0")
                {
                    _isImageNative.transform.GetChild(1).GetComponent <Text> ().text = "画像なし";
                }
                else if (SearchCondition._isImage == "1")
                {
                    _isImageNative.transform.GetChild(1).GetComponent <Text> ().text = "画像あり";
                }
                else
                {
                    _isImageNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                }
                _isImageAPIThrow = SearchCondition._isImage;
            }
            else
            {
                _isImageNative.transform.GetChild(0).gameObject.SetActive(false);
                _isImageNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                _isImageAPIThrow = "";
            }

            ///// 距離の条件の場合の初期化処理。
            if (string.IsNullOrEmpty(SearchCondition._radius) == false)
            {
                _radiusNative.transform.GetChild(0).gameObject.SetActive(false);
                _radiusNative.transform.GetChild(1).gameObject.SetActive(true);

                var radiusText = CommonModelHandle.GetByIdBaseData(SearchCondition._radius, CurrentProfSettingStateType.Radius);

                if (radiusText != null)
                {
                    _radiusNative.transform.GetChild(1).GetComponent <Text> ().text = radiusText.name;
                }
                else
                {
                    _radiusNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                }
            }
            else
            {
                _radiusNative.transform.GetChild(0).gameObject.SetActive(false);
                _radiusNative.transform.GetChild(1).gameObject.SetActive(true);
                _radiusNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
            }

            /// キーワード条件の場合の初期化処理
            if (string.IsNullOrEmpty(SearchCondition._keyword) == false)
            {
                _keyword.text = SearchCondition._keyword;
            }

            yield break;
        }
Beispiel #13
0
    public void OnUpdateItem(int itemCount, GameObject obj)
    {
        if (itemCount < 0 || itemCount >= max)
        {
            obj.SetActive(false);
        }
        else
        {
            obj.SetActive(true);

            if (obj.GetComponentInChildren <ProfileDataSetItem> () != null)
            {
                if (MypageEventManager.Instance != null)
                {
                    switch (MypageEventManager.Instance._currentProfSettingState)
                    {
                    case CurrentProfSettingStateType.Pref:
                        var pref = CommonModelHandle.GetPrefData();
                        id    = pref[itemCount].id;
                        value = pref[itemCount].name;
                        break;

                    case CurrentProfSettingStateType.City:
                        string prefId = MypageEventManager.Instance._prefId;
                        var    city   = CommonModelHandle.GetCityData(prefId);

                        if (city.Count > 0)
                        {
                            id    = city[itemCount].id;
                            value = city[itemCount].name;
                        }
                        break;

                    case CurrentProfSettingStateType.BloodType:
                        var bloodType = InitDataApi._httpCatchData.result.blood_type;
                        id    = bloodType [itemCount].id;
                        value = bloodType [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.HairStyle:
                        var hairStyle = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.HairStyle
                            );
                        id    = hairStyle [itemCount].name;
                        value = hairStyle [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.BodyType:
                        var bodyType = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.BodyType
                            );
                        id    = bodyType [itemCount].name;
                        value = bodyType [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Glasses:
                        var glasses = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Glasses
                            );
                        id    = glasses [itemCount].name;
                        value = glasses [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Type:
                        var type = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Type
                            );
                        id    = type [itemCount].name;
                        value = type [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Personality:
                        var personality = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Personality
                            );
                        id    = personality [itemCount].name;
                        value = personality [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Holiday:
                        var holiday = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Holiday
                            );
                        id    = holiday [itemCount].name;
                        value = holiday [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.AnnualIncome:
                        var annualIncome = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.AnnualIncome
                            );
                        id    = annualIncome [itemCount].name;
                        value = annualIncome [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Education:
                        var education = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Education
                            );
                        id    = education [itemCount].name;
                        value = education [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Housemate:
                        var housemate = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Housemate
                            );
                        id    = housemate [itemCount].name;
                        value = housemate [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Sibling:
                        var sibling = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Sibling
                            );
                        id    = sibling [itemCount].name;
                        value = sibling [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Alcohol:
                        var alcohol = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Alcohol
                            );
                        id    = alcohol [itemCount].name;
                        value = alcohol [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Tobacco:
                        var tobacco = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Tobacco
                            );
                        id    = tobacco [itemCount].name;
                        value = tobacco [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Car:
                        var car = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Car
                            );
                        id    = car [itemCount].name;
                        value = car [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Pet:
                        var pet = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Pet
                            );
                        id    = pet [itemCount].name;
                        value = pet [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Hobby:
                        var hobby = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Hobby
                            );
                        id    = hobby [itemCount].name;
                        value = hobby [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Interest:
                        var interest = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Interest
                            );
                        id    = interest [itemCount].name;
                        value = interest [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Marital:
                        var marital = CommonModelHandle.GetNameMaster(
                            AppStartLoadBalanceManager._gender,
                            CurrentProfSettingStateType.Marital
                            );
                        id    = marital [itemCount].name;
                        value = marital [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Gender:
                        var gender = InitDataApi._httpCatchData.result.sex_cd;
                        id    = gender[itemCount].id;
                        value = gender[itemCount].name;
                        break;

                    case CurrentProfSettingStateType.Radius:
                        var radius = InitDataApi._httpCatchData.result.radius;
                        id    = radius[itemCount].id;
                        value = radius[itemCount].name;
                        break;
                    }
                }

                if (PanelStartInputUserData.Instance != null)
                {
                    switch (PanelStartInputUserData.Instance._currentProfSettingState)
                    {
                    case CurrentProfSettingStateType.Pref:
                        var pref = CommonModelHandle.GetPrefData();
                        id    = pref [itemCount].id;
                        value = pref [itemCount].name;
                        break;

                    case CurrentProfSettingStateType.City:
                        string prefId = PanelStartInputUserData.Instance._prefId;
                        var    city   = CommonModelHandle.GetCityData(prefId);

                        if (city.Count > 0)
                        {
                            id    = city [itemCount].id;
                            value = city [itemCount].name;
                        }
                        break;
                    }
                }
                var item = obj.GetComponentInChildren <ProfileDataSetItem> ();
                item.UpdateItem(itemCount, id, value);
            }
        }
    }
Beispiel #14
0
        /// <summary>
        /// Gets the profile API.
        /// </summary>
        /// <returns>The profile API.</returns>
        /// <param name="toUserId">To user identifier.</param>
        private IEnumerator GetProfileApi(string toUserId)
        {
            _profImage.texture  = Resources.Load("Texture/noimage_user") as Texture;
            _coverImage.texture = Resources.Load("Texture/noimage_cover") as Texture;


            _loadingOverlay.SetActive(true);
            while (GetUserApi._success == false)
            {
                yield return(GetUserApi._success == true);
            }

            string isFavorite = GetUserApi._httpOtherUserCatchData.is_favorite;
            string isBlock    = GetUserApi._httpOtherUserCatchData.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 = GetUserApi._httpOtherUserCatchData.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;
            }

            _loadingOverlay.SetActive(false);

            var user = GetUserApi._httpOtherUserCatchData;

            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 && user.body_type != null && user.body_type.Count > 0)
            {
                _body_type.text = user.body_type[0];
            }

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

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

            if (_type != null && user.type != null && user.type.Count > 0)
            {
                _type.text = user.type[0];//TODO: 複数選択可・対応
            }
            if (_personality != null && user.personality != null && user.personality.Count > 0)
            {
                _personality.text = user.personality[0];//TODO: 複数選択可・対応
            }
            if (_holiday != null && user.holiday != null && user.holiday.Count > 0)
            {
                _holiday.text = user.holiday[0];
            }

            if (_annual_income && user.annual_income != null && user.annual_income.Count > 0)
            {
                _annual_income.text = user.annual_income[0];
            }

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

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

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

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

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

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

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

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

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

            if (_marital != null && user.marital != null && user.marital.Count > 0)
            {
                _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, MessageUserListEntity.UserList user, bool isInfo = false)
    {
        if (isInfo == true)
        {
            this.gameObject.name = "info_" + user.user.id + "-" + user.time_ago;
        }
        else
        {
            this.gameObject.name = user.user.id;
        }

        _delObj.name = user.user.id;

        if (PanelTalkList.Instance._displayState == PanelTalkList.DisplayState.ListShow)
        {
            _delObj.GetComponent <Toggle> ().isOn = false;
            this.GetComponent <Button> ().enabled = true;
        }
        else
        {
            if (PanelTalkList.Instance._msgDeleteList.Count > 0)
            {
                if (PanelTalkList.Instance._msgDeleteList.Contains(_delObj.name) == false)
                {
                    _delObj.GetComponent <Toggle> ().isOn = false;
                }
                else if (PanelTalkList.Instance._msgDeleteList.Contains(_delObj.name) == true)
                {
                    _delObj.GetComponent <Toggle> ().isOn = true;
                }
            }
        }

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

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

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

        if (_userPlace != null)
        {
            _userPlace.text = CommonModelHandle.GetPrefDataById(user.user.pref).name + " " + CommonModelHandle.GetCityDataById(user.user.city_id).name;
        }

        if (_eazyTitle != null)
        {
            if (user.message.Length > 20)
            {
                _eazyTitle.text = user.message.Substring(0, 20) + "…";
            }
            else
            {
                _eazyTitle.text = user.message;
            }
        }

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

        if (_read != null)
        {
            if (EventManager.MessageEventManager.Instance._msgReads.Contains(user.user.id))
            {
                _read.text = "";
            }
            else
            {
                _read.text = user.status;
            }
        }
    }
        /// <summary>
        /// Sets the data.
        /// マスターデータから動的に値が変更する所用
        /// </summary>
        public void SetData()
        {
            string prefId      = MypageEventManager.Instance._prefId;
            string cityId      = MypageEventManager.Instance._cityId;
            string bloodTypeId = MypageEventManager.Instance._bloodType;
            string birthDate   = "";

            #if UNITY_EDITOR
            //生年月日
            if (_dropdownYear.value != 0 && _dropdownMonth.value != 0 && _dropdownDays.value != 0)
            {
                birthDate = _birthYear [_dropdownYear.value] + "-" + _birthMonth [_dropdownMonth.value] + "-" + _birthDays [_dropdownDays.value];
            }
            else if (_dropdownYear.GetComponentInChildren <Text>().text != null &&
                     _dropdownMonth.GetComponentInChildren <Text>().text != null &&
                     _dropdownDays.GetComponentInChildren <Text>().text != null
                     )
            {
                birthDate = _dropdownYear.GetComponentInChildren <Text>().text + "-" + _dropdownMonth.GetComponentInChildren <Text>().text + "-" + _dropdownDays.GetComponentInChildren <Text>().text;
            }
#elif !UNITY_EDITOR && UNITY_IOS || UNITY_ANDROID
            //IOSとアンドロイドの場合の処理。
            if (string.IsNullOrEmpty(MypageEventManager.Instance._birthDate) == false)
            {
                birthDate = MypageEventManager.Instance._birthDate;
                string[] bdArray = MypageEventManager.Instance._birthDate.Split('-');
                _birthdayObjNative.transform.GetChild(0).gameObject.SetActive(false);
                _birthdayObjNative.transform.GetChild(1).GetComponent <Text> ().text = string.Format("{0}年{1}月{2}日", bdArray[0], bdArray[1], bdArray[2]);
            }
#endif


            //プロフ更新APIに送信するデータをセット。
            //データをセットする箇所
            MypageEventManager.Instance._userDataBasic.user_key = AppStartLoadBalanceManager._userKey;
            //性別は規定、変えれない。
            MypageEventManager.Instance._userDataBasic.sex_cd = AppStartLoadBalanceManager._gender;

            MypageEventManager.Instance._userDataBasic.name       = _nickName.GetComponent <InputField> ().text;
            MypageEventManager.Instance._userDataBasic.birth_date = birthDate;
            MypageEventManager.Instance._userDataBasic.height     = _tall.text;
            MypageEventManager.Instance._userDataBasic.weight     = _weight.text;
            MypageEventManager.Instance._userDataBasic.pref       = prefId;

            if (MypageEventManager.Instance._prefChange == true)
            {
                MypageEventManager.Instance._userDataBasic.city_id = "";
            }
            else
            {
                MypageEventManager.Instance._userDataBasic.city_id = cityId;
            }

            MypageEventManager.Instance._userDataBasic.blood_type    = bloodTypeId;
            MypageEventManager.Instance._userDataBasic.profile       = MypageEventManager.Instance._profile;
            MypageEventManager.Instance._userDataBasic.hair_style    = MypageEventManager.Instance._hairStyle;
            MypageEventManager.Instance._userDataBasic.body_type     = MypageEventManager.Instance._bodyType;
            MypageEventManager.Instance._userDataBasic.glasses       = MypageEventManager.Instance._glasses;
            MypageEventManager.Instance._userDataBasic.type          = MypageEventManager.Instance._type;        //TODO: 複数選択可・対応
            MypageEventManager.Instance._userDataBasic.personality   = MypageEventManager.Instance._personality; //TODO: 複数選択可・対応
            MypageEventManager.Instance._userDataBasic.holiday       = MypageEventManager.Instance._holiday;
            MypageEventManager.Instance._userDataBasic.annual_income = MypageEventManager.Instance._annualIncome;
            MypageEventManager.Instance._userDataBasic.education     = MypageEventManager.Instance._education;
            MypageEventManager.Instance._userDataBasic.housemate     = MypageEventManager.Instance._housemate;
            MypageEventManager.Instance._userDataBasic.hair_style    = MypageEventManager.Instance._hairStyle;
            MypageEventManager.Instance._userDataBasic.sibling       = MypageEventManager.Instance._sibling;
            MypageEventManager.Instance._userDataBasic.alcohol       = MypageEventManager.Instance._alcohol;
            MypageEventManager.Instance._userDataBasic.tobacco       = MypageEventManager.Instance._tobacco;
            MypageEventManager.Instance._userDataBasic.car           = MypageEventManager.Instance._car;
            MypageEventManager.Instance._userDataBasic.pet           = MypageEventManager.Instance._pet;
            MypageEventManager.Instance._userDataBasic.hobby         = MypageEventManager.Instance._hobby;
            MypageEventManager.Instance._userDataBasic.interest      = MypageEventManager.Instance._interest;
            MypageEventManager.Instance._userDataBasic.marital       = MypageEventManager.Instance._marital;

            //選択、入力した項目をヴューにセットするデータ。
            if (string.IsNullOrEmpty(prefId) == false)
            {
                _pref.text = CommonModelHandle.GetPrefDataById(prefId).name;
            }

            if (MypageEventManager.Instance._prefChange == true)
            {
                _city.text = "";
                MypageEventManager.Instance._prefChange = false;
            }
            else if (string.IsNullOrEmpty(cityId) == false)
            {
                _city.text = CommonModelHandle.GetCityDataById(cityId).name;
            }

            if (MypageEventManager.Instance._hairStyle != null && MypageEventManager.Instance._hairStyle.Count > 0)
            {
                _hairStyle.text = MypageEventManager.Instance._hairStyle[0];
            }

            if (MypageEventManager.Instance._bodyType != null && MypageEventManager.Instance._bodyType.Count > 0)
            {
                _bodyType.text = MypageEventManager.Instance._bodyType[0];
            }

            if (MypageEventManager.Instance._glasses != null && MypageEventManager.Instance._glasses.Count > 0)
            {
                _glasses.text = MypageEventManager.Instance._glasses[0];
            }

            if (MypageEventManager.Instance._type != null && MypageEventManager.Instance._type.Count > 0)
            {
                _type.text = MypageEventManager.Instance._type[0];     //TODO: 複数選択可・対応
            }
            if (MypageEventManager.Instance._personality != null && MypageEventManager.Instance._personality.Count > 0)
            {
                _personality.text = MypageEventManager.Instance._personality[0]; //TODO: 複数選択可・対応
            }
            if (MypageEventManager.Instance._holiday != null && MypageEventManager.Instance._holiday.Count > 0)
            {
                _holiday.text = MypageEventManager.Instance._holiday[0];
            }

            if (MypageEventManager.Instance._annualIncome != null && MypageEventManager.Instance._annualIncome.Count > 0)
            {
                _annualIncome.text = MypageEventManager.Instance._annualIncome[0];
            }

            if (MypageEventManager.Instance._education != null && MypageEventManager.Instance._education.Count > 0)
            {
                _education.text = MypageEventManager.Instance._education[0];
            }

            if (MypageEventManager.Instance._housemate != null && MypageEventManager.Instance._housemate.Count > 0)
            {
                _housemate.text = MypageEventManager.Instance._housemate[0];
            }

            if (MypageEventManager.Instance._sibling != null && MypageEventManager.Instance._sibling.Count > 0)
            {
                _sibling.text = MypageEventManager.Instance._sibling[0];
            }

            if (MypageEventManager.Instance._alcohol != null && MypageEventManager.Instance._alcohol.Count > 0)
            {
                _alcohol.text = MypageEventManager.Instance._alcohol[0];
            }

            if (MypageEventManager.Instance._tobacco != null && MypageEventManager.Instance._tobacco.Count > 0)
            {
                _tobacco.text = MypageEventManager.Instance._tobacco[0];
            }

            if (MypageEventManager.Instance._car != null && MypageEventManager.Instance._car.Count > 0)
            {
                _car.text = MypageEventManager.Instance._car[0];
            }

            if (MypageEventManager.Instance._pet != null && MypageEventManager.Instance._pet.Count > 0)
            {
                _pet.text = MypageEventManager.Instance._pet[0];
            }

            if (MypageEventManager.Instance._hobby != null && MypageEventManager.Instance._hobby.Count > 0)
            {
                _hobby.text = MypageEventManager.Instance._hobby[0];
            }

            if (MypageEventManager.Instance._interest != null && MypageEventManager.Instance._interest.Count > 0)
            {
                _interest.text = MypageEventManager.Instance._interest[0];
            }

            if (MypageEventManager.Instance._marital != null && MypageEventManager.Instance._marital.Count > 0)
            {
                _marital.text = MypageEventManager.Instance._marital[0];
            }

            _nickName.GetComponent <InputField> ().text = MypageEventManager.Instance._nickName;

            if (MypageEventManager.Instance._cpsTypeSliderWeight == CurrentProfSettingStateType.None)
            {
                _weight.text        = MypageEventManager.Instance._weight;
                _weightSlider.value = float.Parse(MypageEventManager.Instance._weight);
            }

            if (MypageEventManager.Instance._cpsTypeSliderHeight == CurrentProfSettingStateType.None)
            {
                _tall.text        = MypageEventManager.Instance._tall;
                _tallSlider.value = float.Parse(MypageEventManager.Instance._tall);
            }


            if (AppStartLoadBalanceManager._gender == ((int)GenderType.FeMale).ToString())
            {
                _gender.text = LocalMsgConst.GENDER_FEMALE;
            }
            else if (AppStartLoadBalanceManager._gender == ((int)GenderType.Male).ToString())
            {
                _gender.text = LocalMsgConst.GENDER_MALE;
            }

            if (MypageEventManager.Instance._profile.Length == 0)
            {
                _profile.text = "未入力";
            }
            else if (MypageEventManager.Instance._profile.Length >= 20)
            {
                _profile.text = MypageEventManager.Instance._profile.Substring(0, 20) + "…";
            }
            else
            {
                _profile.text = MypageEventManager.Instance._profile.Substring(0, MypageEventManager.Instance._profile.Length) + "…";
            }
            _profileInput.GetComponent <InputField> ().text = MypageEventManager.Instance._profile;
            if (string.IsNullOrEmpty(bloodTypeId) == false)
            {
                string bloodTypeMsg = CommonModelHandle.GetByIdBaseData(bloodTypeId, CurrentProfSettingStateType.BloodType).name;
                _bloodType.text = bloodTypeMsg + LocalMsgConst.BLOOD_TYPE_JA;
            }
        }
Beispiel #17
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>
        /// Places the of origin.
        /// 都道府県設定(出身地設定), 市区町村設定(出身地詳細)パネルのオープン
        /// </summary>
        public void PlaceOfOriginOpen(bool isPref)
        {
#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS)
            //#if !UNITY_EDITOR && (UNITY_IOS)
            //Native Picker方式に変更。
            if (InitDataApi._httpCatchData != null)
            {
                List <string> tmpDataList = new List <string> ();
                string []     itemList    = { "" };

#if UNITY_IOS
                tmpDataList.Add("");
#endif

                //都道府県、選択。
                if (isPref == true)
                {
                    System.DateTime defaultSetDate = GetDateTimeByAge(18);

                    foreach (var tmpItem in InitDataApi._httpCatchData.result.pref)
                    {
                        tmpDataList.Add(tmpItem.name);
                    }
                    itemList = tmpDataList.ToArray();

                    //市区町村、選択。
                }
                else if (isPref == false && string.IsNullOrEmpty(_prefId) == false)
                {
                    foreach (var tmpItem in CommonModelHandle.GetCityData(_prefId))
                    {
                        tmpDataList.Add(tmpItem.Value.name);
                    }
                    itemList = tmpDataList.ToArray();
                }
                else
                {
                    Debug.Log(" 例外の処理。 ");
                    return;
                }

                //ここでイベントを「OKかキャンセル」のイベントをキャッチ。
                NativePicker.Instance.ShowCustomPicker(toScreenRect(_drawRect), itemList, (long val) =>
                {
                    if (isPref == true)
                    {
                        _currentProfSettingState = CurrentProfSettingStateType.Pref;
                        _cityId           = "";
                        _city.text        = "";
                        _userData.city_id = "";
                        _pref.text        = itemList[val];
#if UNITY_IOS
                        _prefId = ((int)val).ToString();
#else
                        _prefId = ((int)val + 1).ToString();
#endif

                        _userData.pref = _prefId;
                    }
                    else if (isPref == false)
                    {
                        _currentProfSettingState = CurrentProfSettingStateType.City;
                        _city.text        = itemList [val];
                        var city          = CommonModelHandle.GetCityDataByName(_city.text);
                        _cityId           = city.id;
                        _userData.city_id = _cityId;
                    }
                }, () => {
                    if (isPref == true)
                    {
                        _pref.text     = "指定しない";
                        _prefId        = "";
                        _userData.pref = _prefId;
                    }
                    else if (isPref == false)
                    {
                        if (string.IsNullOrEmpty(_prefId) == false)
                        {
                            _city.text        = "";
                            _cityId           = "";
                            _userData.city_id = _cityId;
                        }
                        else
                        {
                            Debug.Log("都道府県を先に選択してください的なポップアップが親切。");
                        }
                    }
                });
            }
#else
            HeaderPanel.Instance.BackButtonSwitch(false);
            HeaderPanel.Instance.BackButtonSwitch(true, PlaceOfOriginCloseEvent);
            if (isPref == true)
            {
                _currentProfSettingState = CurrentProfSettingStateType.Pref;
                _cityId           = "";
                _city.text        = "";
                _userData.city_id = "";
            }
            else if (isPref == false)
            {
                _currentProfSettingState = CurrentProfSettingStateType.City;
            }

            _profTemplatefInfiniteLimitScroll.Init();
            _backSwipe.EventMessageTarget = _panelProfileSetTemplate;

            PanelAnimate(_panelProfileSetTemplate);
                        #endif
        }
Beispiel #19
0
        /// <summary>
        /// Inits the coroutine.
        /// </summary>
        /// <returns>The coroutine.</returns>
        private IEnumerator InitCoroutine()
        {
            //ここからマスターデータを当てるDropdownに当てる処理 - ここから
            if (InitDataApi._httpCatchData == null)
            {
                new InitDataApi();
                while (InitDataApi._success == true)
                {
                    yield return(InitDataApi._success == false);
                }
            }

            Debug.Log(InitDataApi._httpCatchData.result.board_category.Count + "  ここを通っていますか? ");
            //カテゴリ - 選択 ここから
            _categoryList = new List <string> ();
            _categoryList.Add("指定しない");
            foreach (var d in InitDataApi._httpCatchData.result.board_category)
            {
                _categoryList.Add(d.name);
            }
            _category.AddOptions(_categoryList);
            //カテゴリ - 選択 ここまで


            //性別 - 選択 ここから
            _genderList = new List <string> ();

            _genderList.Add("指定しない");
            foreach (var d in InitDataApi._httpCatchData.result.sex_cd)
            {
                _genderList.Add(d.name);
            }

            _gender.AddOptions(_genderList);
            //性別 - 選択 ここまで


            //体型 - 選択 ここから
            _bodyTypeList = new List <string> ();
            _bodyTypeList.Add("指定しない");

            string gender = "1";

            if (AppStartLoadBalanceManager._gender == ((int)GenderType.Male).ToString())
            {
                gender = ((int)GenderType.Male).ToString();
            }
            else if (AppStartLoadBalanceManager._gender == ((int)GenderType.FeMale).ToString())
            {
                gender = ((int)GenderType.FeMale).ToString();
            }

            var bodyType = CommonModelHandle.GetNameMaster(gender, CurrentProfSettingStateType.BodyType);

            foreach (var d in bodyType)
            {
                _bodyTypeList.Add(d.name);
            }
            _bodyType.AddOptions(_bodyTypeList);
            //体型 - 選択 ここまで


            //年齢 - 何歳まで ここから
            _ageFromList = new List <string> ();
            _ageFromList.Add("18");
            for (int i = 18; i <= 100; i++)
            {
                _ageFromList.Add(i.ToString());
            }
            _ageFrom.AddOptions(_ageFromList);
            //年齢 - 何歳まで ここまで


            //年齢 - 何歳まで ここから
            _ageToList = new List <string> ();
            _ageToList.Add("100");
            for (int i = 18; i <= 100; i++)
            {
                _ageToList.Add(i.ToString());
            }

            _ageTo.AddOptions(_ageToList);
            //年齢 - 何歳まで ここまで


            //身長から - ここから
            _heightFromList = new List <string> ();
            _heightFromList.Add("110");
            for (int i = 110; i <= 220; i++)
            {
                _heightFromList.Add(i.ToString());
            }
            _heightFrom.AddOptions(_heightFromList);
            //身長から - ここまで

            //身長まで - ここから
            _heightToList = new List <string> ();
            _heightToList.Add("220");
            for (int i = 110; i <= 220; i++)
            {
                _heightToList.Add(i.ToString());
            }
            _heightTo.AddOptions(_heightToList);
            //身長まで - ここまで

            //距離 - ここから
            _radiusList = new List <string> ();
            _radiusList.Add("指定しない");
            foreach (var d in InitDataApi._httpCatchData.result.radius)
            {
                _radiusList.Add(d.name);
            }
            _radius.AddOptions(_radiusList);
            //距離 - ここまで


            //ここまでマスターデータを当てるDropdownに当てる処理 - ここまで
        }
Beispiel #20
0
        /// <summary>
        /// Displaies the data set.
        /// </summary>
        /// <returns>The data set.</returns>
        /// <param name="stateType">State type.</param>
        /// <param name="key">Key.</param>
        /// <param name="value">Value.</param>
        private void DisplayDataSet(SearchConditionType stateType, int key, string value)
        {
#if UNITY_IOS
            key = key - 1;
#endif
            switch (stateType)
            {
            case SearchConditionType.Order:
                if (key == 0)
                {
                    _orderAPIThrow = "1";
                    _orderNative.transform.GetChild(1).gameObject.GetComponent <Text> ().text = value;
                }
                else
                {
                    var order = CommonModelHandle.GetByNameBaseData(value, CurrentProfSettingStateType.UserSort);
                    _orderAPIThrow = order.id;
                    _orderNative.transform.GetChild(1).gameObject.GetComponent <Text> ().text = order.name;
                }
                break;

            case SearchConditionType.Gender:
                if (key == 0)
                {
                    _sexAPIThrow = "";
                    _genderNative.transform.GetChild(1).GetComponent <Text> ().text = value;
                }
                else
                {
                    var gender = CommonModelHandle.GetByNameBaseData(value, CurrentProfSettingStateType.Gender);
                    _sexAPIThrow = gender.id;
                    _genderNative.transform.GetChild(1).GetComponent <Text> ().text = value;
                }
                break;

            case SearchConditionType.AgeHigh:
                _ageHighAPIThrow = value;
                _ageToNative.transform.GetChild(1).gameObject.GetComponent <Text> ().text = value;
                break;

            case SearchConditionType.AgeLow:
                _ageLowAPIThrow = value;
                _ageFromNative.transform.GetChild(1).gameObject.GetComponent <Text> ().text = value;
                break;

            case SearchConditionType.TallHigh:
                _heightToAPIThrow = value;
                _heightToNative.transform.GetChild(1).gameObject.GetComponent <Text> ().text = value;
                break;

            case SearchConditionType.TallLow:
                _heightFromAPIThrow = value;
                _heightFromNative.transform.GetChild(1).gameObject.GetComponent <Text> ().text = value;
                break;

            case SearchConditionType.BodyType:
                if (key == 0)
                {
                    _bodyTypeAPIThrow = "";
                    _bodyTypeNative.transform.GetChild(0).gameObject.SetActive(false);
                    _bodyTypeNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                }
                else
                {
                    _bodyTypeAPIThrow = value;
                    _bodyTypeNative.transform.GetChild(0).gameObject.SetActive(false);
                    _bodyTypeNative.transform.GetChild(1).GetComponent <Text> ().text = value;
                }
                break;

            case SearchConditionType.IsImage:
                if (key == 0)
                {
                    _isImageAPIThrow = "";
                    _isImageNative.transform.GetChild(0).gameObject.SetActive(false);
                    _isImageNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                }
                else
                {
                    if ((key - 1) == 0)
                    {
                        _isImageAPIThrow = "0";
                    }
                    else
                    {
                        _isImageAPIThrow = (key - 1).ToString();
                    }

                    _isImageNative.transform.GetChild(0).gameObject.SetActive(false);
                    _isImageNative.transform.GetChild(1).GetComponent <Text> ().text = value;
                }
                break;

            case SearchConditionType.Radius:
                if (key == 0)
                {
                    _radiusAPIThrow = "";
                    _radiusNative.transform.GetChild(0).gameObject.SetActive(false);
                    _radiusNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                }
                else
                {
                    var r = CommonModelHandle.GetByNameBaseData(value, CurrentProfSettingStateType.Radius);
                    if (r != null)
                    {
                        _radiusAPIThrow = r.id;
                        _radiusNative.transform.GetChild(0).gameObject.SetActive(false);
                        _radiusNative.transform.GetChild(1).GetComponent <Text> ().text = value;
                    }
                    else
                    {
                        _radiusAPIThrow = "";
                        _radiusNative.transform.GetChild(0).gameObject.SetActive(false);
                        _radiusNative.transform.GetChild(1).GetComponent <Text> ().text = "指定しない";
                    }
                }
                break;
            }
        }
Beispiel #21
0
        /// <summary>
        /// Inits the coroutine.
        /// </summary>
        /// <returns>The coroutine.</returns>
        private IEnumerator InitCoroutine()
        {
            string _commonFileName = LocalFileConstants.GetLocalFileDir() + LocalFileConstants.COMMON_LOCAL_FILE_NAME;

            Helper.LocalFileHandler.Init(_commonFileName);

            //ファイルが作成されるまでポーリングして処理待ち
            while (System.IO.File.Exists(_commonFileName) == false)
            {
                yield return(System.IO.File.Exists(_commonFileName) == true);
            }

            SearchEventManager.SearchCondition SearchCondition = LocalFileHandler.Load <SearchEventManager.SearchCondition> (LocalFileConstants.SEARCH_CONDITION_KEY);

            //ここからマスターデータを当てるDropdownに当てる処理 - ここから
            if (InitDataApi._httpCatchData == null)
            {
                new InitDataApi();
                while (InitDataApi._success == true)
                {
                    yield return(InitDataApi._success == false);
                }
            }

            //表示順 - 選択 ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            _orderList = new List <string> ();
            //ローカルにデータが存在する場合。

            _orderList.Add("指定しない");

            foreach (var d in InitDataApi._httpCatchData.result.user_sort)
            {
                _orderList.Add(d.name);
            }

            _order.AddOptions(_orderList);

            if (string.IsNullOrEmpty(SearchCondition._order) == false)
            {
                _order.value = int.Parse(CommonModelHandle.GetByIdBaseData(SearchCondition._order, CurrentProfSettingStateType.UserSort).id);
            }

            //表示順 - 選択 ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※


            //性別 - 選択 ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            _genderList = new List <string> ();
            //ローカルにデータが存在する場合。

            _genderList.Add("指定しない");
            foreach (var d in InitDataApi._httpCatchData.result.sex_cd)
            {
                _genderList.Add(d.name);
            }
            _gender.AddOptions(_genderList);

            if (string.IsNullOrEmpty(SearchCondition._sex) == false)
            {
                if (CommonModelHandle.GetByIdBaseData(SearchCondition._sex, CurrentProfSettingStateType.Gender).name == "男性")
                {
                    _gender.value = 1;
                }
                else if (CommonModelHandle.GetByIdBaseData(SearchCondition._sex, CurrentProfSettingStateType.Gender).name == "女性")
                {
                    _gender.value = 2;
                }
            }
            else
            {
                _gender.value = 0;
            }
            //性別 - 選択 ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※



            //体型 - 選択 ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            _bodyTypeList = new List <string> ();
            _bodyTypeList.Add("指定しない");

            string gender = "1";

            if (AppStartLoadBalanceManager._gender == ((int)GenderType.Male).ToString())
            {
                gender = ((int)GenderType.Male).ToString();
            }
            else if (AppStartLoadBalanceManager._gender == ((int)GenderType.FeMale).ToString())
            {
                gender = ((int)GenderType.FeMale).ToString();
            }

            var bodyType = CommonModelHandle.GetNameMaster(gender, CurrentProfSettingStateType.BodyType);

            foreach (var d in bodyType)
            {
                _bodyTypeList.Add(d.name);
            }

            _bodyType.AddOptions(_bodyTypeList);

            if (string.IsNullOrEmpty(SearchCondition._bodyType) == false)
            {
                _bodyType.value = DropdownValueCalc(SearchCondition._bodyType, bodyType);
            }
            else
            {
                _bodyType.value = 0;
            }
            //体型 - 選択 ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※


            //年齢 - 何歳まで ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            _ageFromList = new List <string> ();
            _ageFromList.Add("18");

            for (int i = 18; i <= 100; i++)
            {
                _ageFromList.Add(i.ToString());
            }

            _ageFrom.AddOptions(_ageFromList);
            _tmpCount = 0;

            if (string.IsNullOrEmpty(SearchCondition._ageFrom) == false)
            {
                foreach (var afl in _ageFromList)
                {
                    if (afl == SearchCondition._ageFrom)
                    {
                        _ageFrom.value = _tmpCount;
                        break;
                    }
                    _tmpCount++;
                }
            }
            else
            {
                _ageFrom.value = 0;
            }
            //年齢 - 何歳まで ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※



            //年齢 - 何歳まで ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            _ageToList = new List <string> ();

            _ageToList.Add("100");
            for (int i = 18; i <= 100; i++)
            {
                _ageToList.Add(i.ToString());
            }

            _ageTo.AddOptions(_ageToList);
            _tmpCount = 0;
            if (string.IsNullOrEmpty(SearchCondition._ageTo) == false)
            {
                foreach (var atl in _ageToList)
                {
                    if (atl == SearchCondition._ageTo)
                    {
                        _ageTo.value = _tmpCount;
                        break;
                    }
                    _tmpCount++;
                }
            }
            else
            {
                _ageTo.value = 0;
            }
            //年齢 - 何歳まで ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※


            //身長から - ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            _heightFromList = new List <string> ();


            _heightFromList.Add("指定なし");

            for (int i = 110; i <= 220; i++)
            {
                _heightFromList.Add(i.ToString());
            }

            _heightFrom.AddOptions(_heightFromList);
            _tmpCount = 0;

            if (string.IsNullOrEmpty(SearchCondition._heightFrom) == false)
            {
                foreach (var hfl in _heightFromList)
                {
                    if (hfl == SearchCondition._heightFrom)
                    {
                        _heightFrom.value = _tmpCount;
                        break;
                    }
                    _tmpCount++;
                }
            }
            else
            {
                _heightFrom.value = 0;
            }
            //身長から - ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※



            //身長まで - ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            _heightToList = new List <string> ();
            _heightToList.Add("指定なし");

            for (int i = 110; i <= 220; i++)
            {
                _heightToList.Add(i.ToString());
            }

            _heightTo.AddOptions(_heightToList);
            _tmpCount = 0;

            if (string.IsNullOrEmpty(SearchCondition._heightTo) == false)
            {
                foreach (var htl in _heightToList)
                {
                    if (htl == SearchCondition._heightTo)
                    {
                        _heightTo.value = _tmpCount;
                        break;
                    }
                    _tmpCount++;
                }
            }
            else
            {
                _heightTo.value = 0;
            }
            //身長まで - ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※


            //距離 - ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            _radiusList = new List <string> ();
            _radiusList.Add("指定しない");

            foreach (var d in InitDataApi._httpCatchData.result.radius)
            {
                _radiusList.Add(d.name);
            }

            _radius.AddOptions(_radiusList);
            _tmpCount = 0;
            if (string.IsNullOrEmpty(SearchCondition._radius) == false)
            {
                foreach (var r in _radiusList)
                {
                    if (r == CommonModelHandle.GetByIdBaseData(SearchCondition._radius, CurrentProfSettingStateType.Radius).name)
                    {
                        _radius.value = _tmpCount;
                        break;
                    }
                    _tmpCount++;
                }
            }
            else
            {
                _radius.value = 0;
            }
            //距離 - ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※



            //画像 - ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            if (string.IsNullOrEmpty(SearchCondition._isImage) == false)
            {
                _isImageListObject.value = int.Parse(SearchCondition._isImage);
            }
            //画像 - ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※



            //キーワードを当てる処理 - ここから ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
            if (string.IsNullOrEmpty(SearchCondition._keyword) == false)
            {
                _keyword.text = SearchCondition._keyword;
            }
            //キーワードを当てる処理 - ここまで ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※


            //ここまでマスターデータを当てるDropdownに当てる処理 - ここまで
        }
        /// <summary>
        /// Displaies the data set.
        /// </summary>
        /// <returns>The data set.</returns>
        /// <param name="stateType">State type.</param>
        /// <param name="setData">Set data.</param>
        private void DisplayDataSet(CurrentProfSettingStateType stateType, int key, string value)
        {
            switch (stateType)
            {
            case CurrentProfSettingStateType.Pref:
                _pref.text = value;
            #if UNITY_IOS
                MypageEventManager.Instance._prefId = (key).ToString();
            #else
                MypageEventManager.Instance._prefId = (key + 1).ToString();
            #endif

                break;

            case CurrentProfSettingStateType.City:
                var city = CommonModelHandle.GetCityDataByName(value);
                _city.text = value;
                MypageEventManager.Instance._cityId = city.id;
                break;

            case CurrentProfSettingStateType.BloodType:
                _bloodType.text = value + LocalMsgConst.BLOOD_TYPE_JA;
#if UNITY_IOS
                MypageEventManager.Instance._bloodType = (key).ToString();
#else
                MypageEventManager.Instance._bloodType = (key + 1).ToString();
#endif
                break;

            case CurrentProfSettingStateType.HairStyle:
                _hairStyle.text = value;
                MypageEventManager.Instance._hairStyle[0] = value;
                break;

            case CurrentProfSettingStateType.BodyType:
                _bodyType.text = value;
                MypageEventManager.Instance._bodyType [0] = value;
                break;

            case CurrentProfSettingStateType.Glasses:
                _glasses.text = value;
                MypageEventManager.Instance._glasses [0] = value;
                break;

            case CurrentProfSettingStateType.Type:
                _type.text = value;
                MypageEventManager.Instance._type [0] = value;
                break;

            case CurrentProfSettingStateType.Personality:
                _personality.text = value;
                MypageEventManager.Instance._personality [0] = value;
                break;

            case CurrentProfSettingStateType.Holiday:
                _holiday.text = value;
                MypageEventManager.Instance._holiday [0] = value;
                break;

            case CurrentProfSettingStateType.AnnualIncome:
                _annualIncome.text = value;
                MypageEventManager.Instance._annualIncome [0] = value;
                break;

            case CurrentProfSettingStateType.Education:
                _education.text = value;
                MypageEventManager.Instance._education [0] = value;
                break;

            case CurrentProfSettingStateType.Housemate:
                _housemate.text = value;
                MypageEventManager.Instance._housemate [0] = value;
                break;

            case CurrentProfSettingStateType.Sibling:
                _sibling.text = value;
                MypageEventManager.Instance._sibling [0] = value;
                break;

            case CurrentProfSettingStateType.Alcohol:
                _alcohol.text = value;
                MypageEventManager.Instance._alcohol [0] = value;
                break;

            case CurrentProfSettingStateType.Tobacco:
                _tobacco.text = value;
                MypageEventManager.Instance._tobacco [0] = value;
                break;

            case CurrentProfSettingStateType.Car:
                _car.text = value;
                MypageEventManager.Instance._car[0] = value;
                break;

            case CurrentProfSettingStateType.Pet:
                _pet.text = value;
                MypageEventManager.Instance._pet [0] = value;
                break;

            case CurrentProfSettingStateType.Hobby:
                _hobby.text = value;
                MypageEventManager.Instance._hobby [0] = value;
                break;

            case CurrentProfSettingStateType.Interest:
                _interest.text = value;
                MypageEventManager.Instance._interest [0] = value;
                break;

            case CurrentProfSettingStateType.Marital:
                _marital.text = value;
                MypageEventManager.Instance._marital[0] = value;
                break;
            }
        }
        /// <summary>
        /// Natives the picker set.
        /// </summary>
        /// <returns>The picker set.</returns>
        /// <param name="stateType">State type.</param>
        private void NativePickerSet(CurrentProfSettingStateType stateType)
        {
            string []     itemList = { "" };
            List <string> list     = new List <string> ();

            #if UNITY_IOS
            list.Add("");
            #endif


            switch (stateType)
            {
            case CurrentProfSettingStateType.Pref:
                var pref = CommonModelHandle.GetPrefData();
                foreach (var p in pref)
                {
                    list.Add(p.Value.name);
                }

                //都道府県選択のスキームに入るから市区町村のデータをリセット。
                MypageEventManager.Instance._cityId = "";
                _city.text = "";

                break;

            case CurrentProfSettingStateType.City:
                var city = CommonModelHandle.GetCityData(MypageEventManager.Instance._prefId);
                foreach (var c in city)
                {
                    list.Add(c.Value.name);
                }
                break;

            case CurrentProfSettingStateType.BloodType:
                foreach (var b in InitDataApi._httpCatchData.result.blood_type)
                {
                    list.Add(b.name);
                }
                break;

            case CurrentProfSettingStateType.Profile:

                break;

            case CurrentProfSettingStateType.HairStyle:
            case CurrentProfSettingStateType.BodyType:
            case CurrentProfSettingStateType.Glasses:
            case CurrentProfSettingStateType.Type:
            case CurrentProfSettingStateType.Personality:
            case CurrentProfSettingStateType.Holiday:
            case CurrentProfSettingStateType.AnnualIncome:
            case CurrentProfSettingStateType.Education:
            case CurrentProfSettingStateType.Housemate:
            case CurrentProfSettingStateType.Sibling:
            case CurrentProfSettingStateType.Alcohol:
            case CurrentProfSettingStateType.Tobacco:
            case CurrentProfSettingStateType.Car:
            case CurrentProfSettingStateType.Pet:
            case CurrentProfSettingStateType.Hobby:
            case CurrentProfSettingStateType.Interest:
            case CurrentProfSettingStateType.Marital:
                var item = CommonModelHandle.GetNameMaster(AppStartLoadBalanceManager._gender, stateType);
                foreach (var i in item)
                {
                    list.Add(i.name);
                }
                break;
            }

            if (list.Count > 0)
            {
                itemList = list.ToArray();

                NativePicker.Instance.ShowCustomPicker(toScreenRect(_drawRect), itemList, 0, (long val) => {
                    //プロフィールの変更がある事を通知する用
                    _isProfileChangeState = true;
                    for (int i = 0; i < list.Count; i++)
                    {
                        if ((int)val == i)
                        {
                            DisplayDataSet(stateType, i, list[i]);
                            break;
                        }
                    }
                }, () => {
                    //ピッカーをキャンセルにした場合。");
                });
            }
        }
Beispiel #24
0
    /// <summary>
    /// Set this instance.
    /// </summary>
    private IEnumerator Set()
    {
        var controllers = GetComponents <MonoBehaviour>()
                          .Where(item => item is IInfiniteScrollSetup)
                          .Select(item => item as IInfiniteScrollSetup)
                          .ToList();

        if (MypageEventManager.Instance)
        {
            switch (MypageEventManager.Instance._currentProfSettingState)
            {
            case CurrentProfSettingStateType.Pref:
                max = InitDataApi._httpCatchData.result.pref.Count;
                break;

            case CurrentProfSettingStateType.City:
                string prefId = MypageEventManager.Instance._prefId;
                max = CommonModelHandle.GetCityData(prefId).Count;
                break;

            case CurrentProfSettingStateType.BloodType:
                max = InitDataApi._httpCatchData.result.blood_type.Count;
                break;

            case CurrentProfSettingStateType.HairStyle:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.HairStyle
                    ).Count;
                break;

            case CurrentProfSettingStateType.BodyType:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.BodyType
                    ).Count;
                break;

            case CurrentProfSettingStateType.Glasses:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Glasses
                    ).Count;
                break;

            case CurrentProfSettingStateType.Type:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Type
                    ).Count;
                break;

            case CurrentProfSettingStateType.Personality:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Personality
                    ).Count;
                break;

            case CurrentProfSettingStateType.Holiday:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Holiday
                    ).Count;
                break;

            case CurrentProfSettingStateType.AnnualIncome:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.AnnualIncome
                    ).Count;
                break;

            case CurrentProfSettingStateType.Education:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Education
                    ).Count;
                break;

            case CurrentProfSettingStateType.Housemate:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Housemate
                    ).Count;
                break;

            case CurrentProfSettingStateType.Sibling:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Sibling
                    ).Count;
                break;

            case CurrentProfSettingStateType.Alcohol:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Alcohol
                    ).Count;
                break;

            case CurrentProfSettingStateType.Tobacco:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Tobacco
                    ).Count;
                break;

            case CurrentProfSettingStateType.Car:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Car
                    ).Count;
                break;

            case CurrentProfSettingStateType.Pet:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Pet
                    ).Count;
                break;

            case CurrentProfSettingStateType.Hobby:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Hobby
                    ).Count;
                break;

            case CurrentProfSettingStateType.Interest:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Interest
                    ).Count;
                break;

            case CurrentProfSettingStateType.Marital:
                max = CommonModelHandle.GetNameMaster(
                    AppStartLoadBalanceManager._gender,
                    CurrentProfSettingStateType.Marital
                    ).Count;
                break;

            case CurrentProfSettingStateType.Gender:
                max = InitDataApi._httpCatchData.result.sex_cd.Count;
                break;

            case CurrentProfSettingStateType.Radius:
                max = InitDataApi._httpCatchData.result.radius.Count;
                break;
            }
        }

        if (PanelStartInputUserData.Instance != null)
        {
            switch (PanelStartInputUserData.Instance._currentProfSettingState)
            {
            case CurrentProfSettingStateType.Pref:
                max = InitDataApi._httpCatchData.result.pref.Count;
                break;

            case CurrentProfSettingStateType.City:
                string prefId = PanelStartInputUserData.Instance._prefId;
                max = CommonModelHandle.GetCityData(prefId).Count;
                break;
            }
        }

        for (int i = 0; i < m_instantateItemCount; i++)
        {
            var item = Instantiate(m_ItemBase) as RectTransform;
            item.SetParent(transform, false);
            item.name             = i.ToString();
            item.anchoredPosition =
                (direction == Direction.Vertical) ?
                new Vector2(0, -ItemScale * (i)) :
                new Vector2(ItemScale * (i), 0);
            m_itemList.Add(item);

            item.gameObject.SetActive(true);

            foreach (var controller in controllers)
            {
                controller.OnUpdateItem(i, item.gameObject);
            }
        }

        foreach (var controller in controllers)
        {
            controller.OnPostSetupItems();
        }
        _isUpdateTrigger = true;
        yield break;
    }