/// <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> /// 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; } }
/// <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; }
/// <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; }