IEnumerator InitFromCondition() { _loadingOverlay.SetActive(true); 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 (SearchCondition != null) { SearchEventManager.Instance._lat = SearchCondition._lat; SearchEventManager.Instance._lng = SearchCondition._lng; SearchEventManager.Instance._order = SearchCondition._order; SearchEventManager.Instance._sex = SearchCondition._sex; SearchEventManager.Instance._ageFrom = SearchCondition._ageFrom; SearchEventManager.Instance._ageTo = SearchCondition._ageTo; SearchEventManager.Instance._heightFrom = SearchCondition._heightFrom; SearchEventManager.Instance._heightTo = SearchCondition._heightTo; SearchEventManager.Instance._bodyType = SearchCondition._bodyType; SearchEventManager.Instance._isImage = SearchCondition._isImage; SearchEventManager.Instance._radius = SearchCondition._radius; SearchEventManager.Instance._keyword = SearchCondition._keyword; } // 通信レスポンス待ってから UserListApi._success = false; new UserListApi( // todo とりあえず試すため全部の設定 あとできちんと値を設定して絞り込むようにしてください AppStartLoadBalanceManager._userKey, EventManager.SearchEventManager.Instance._lat, EventManager.SearchEventManager.Instance._lng, EventManager.SearchEventManager.Instance._order, EventManager.SearchEventManager.Instance._sex, EventManager.SearchEventManager.Instance._ageFrom, EventManager.SearchEventManager.Instance._ageTo, EventManager.SearchEventManager.Instance._heightFrom, EventManager.SearchEventManager.Instance._heightTo, EventManager.SearchEventManager.Instance._bodyType, EventManager.SearchEventManager.Instance._isImage, EventManager.SearchEventManager.Instance._radius, EventManager.SearchEventManager.Instance._keyword, "1" ); while (UserListApi._success == false) { yield return(UserListApi._success == true); } SearchEventManager.SearchCondition condition = new SearchEventManager.SearchCondition(); condition._lat = SearchEventManager.Instance._lat; condition._lng = SearchEventManager.Instance._lng; condition._order = SearchEventManager.Instance._order; condition._sex = SearchEventManager.Instance._sex; condition._ageFrom = SearchEventManager.Instance._ageFrom; condition._ageTo = SearchEventManager.Instance._ageTo; condition._heightFrom = SearchEventManager.Instance._heightFrom; condition._heightTo = SearchEventManager.Instance._heightTo; condition._bodyType = SearchEventManager.Instance._bodyType; condition._isImage = SearchEventManager.Instance._isImage; condition._radius = SearchEventManager.Instance._radius; condition._keyword = SearchEventManager.Instance._keyword; LocalFileHandler.Save <SearchEventManager.SearchCondition>(LocalFileConstants.SEARCH_CONDITION_KEY, condition); LocalFileHandler.Flush(); if (UserListApi._httpCatchData.result.users != null) { if (UserListApi._httpCatchData.result.users.Count > 0) { _InfiniteLimitScroll.GetComponent <SearchListSmallImageInfiniteLimitScroll> ().m_currentItemNo = 0; _InfiniteLimitScroll.GetComponent <SearchListSmallImageInfiniteLimitScroll> ().Init(); EventManager.SearchEventManager.Instance._nowShowPage = "1"; _InfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.9995f; if (UserListApi._httpCatchData.result.users.Count >= 20) { _nextButton.SetActive(true); } } else { // リストのないページカウントになってるので 一旦通信とリストの更新をさせないようにする _disablePageForNetworkCall = true; _InfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.005f; Debug.Log("存在しないページにアクセスしようとしたのでやめる"); PopupPanel.Instance.PopMessageInsert( LocalMsgConst.LIST_SEARCH_ZERO, LocalMsgConst.OK, PanelListZeroFinishClose ); PanelPopupAnimate(GameObject.FindGameObjectWithTag(CommonConstants.POPUP_BASIC_TAG)); } } else { _disablePageForNetworkCall = true; _InfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.005f; Debug.Log("存在しないページにアクセスしようとしたのでやめる"); } _loadingOverlay.SetActive(false); }
/// <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に当てる処理 - ここまで }
// 初期化 changepaeはページが進むか戻るか IEnumerator Init(int ChangePage) { //HeaderPanel.Instance.GetComponent<Text> ().text = PanelStateManager.GetHeaderStringByKey("BulletInBoardPanel"); _loadingOverlay.SetActive(true); // 通信レスポンス待ってから int page_next = int.Parse(EventManager.BulletinBoardEventManager.Instance._nowShowPage) + ChangePage; 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); } BulletinBoardEventManager.SearchCondition SearchCondition = LocalFileHandler.Load <BulletinBoardEventManager.SearchCondition>(LocalFileConstants.BBS_SEARCH_CONDITION_KEY); //条件検索のデータがローカルファイルに残っている場合。 if (SearchCondition != null) { if (string.IsNullOrEmpty(SearchCondition._lat) == false) { BulletinBoardEventManager.Instance._lat = SearchCondition._lat; } if (string.IsNullOrEmpty(SearchCondition._lng) == false) { BulletinBoardEventManager.Instance._lng = SearchCondition._lng; } if (string.IsNullOrEmpty(SearchCondition._CategoryID) == false) { BulletinBoardEventManager.Instance._CategoryID = SearchCondition._CategoryID; } if (string.IsNullOrEmpty(SearchCondition._sex) == false) { BulletinBoardEventManager.Instance._sex = SearchCondition._sex; } if (string.IsNullOrEmpty(SearchCondition._ageFrom) == false) { BulletinBoardEventManager.Instance._ageFrom = SearchCondition._ageFrom; } if (string.IsNullOrEmpty(SearchCondition._ageTo) == false) { BulletinBoardEventManager.Instance._ageTo = SearchCondition._ageTo; } if (string.IsNullOrEmpty(SearchCondition._heightFrom) == false) { BulletinBoardEventManager.Instance._heightFrom = SearchCondition._heightFrom; } if (string.IsNullOrEmpty(SearchCondition._heightTo) == false) { BulletinBoardEventManager.Instance._heightTo = SearchCondition._heightTo; } if (string.IsNullOrEmpty(SearchCondition._bodyType) == false) { BulletinBoardEventManager.Instance._bodyType = SearchCondition._bodyType; } if (string.IsNullOrEmpty(SearchCondition._isImage) == false) { BulletinBoardEventManager.Instance._isImage = SearchCondition._isImage; } if (string.IsNullOrEmpty(SearchCondition._radius) == false) { BulletinBoardEventManager.Instance._radius = SearchCondition._radius; } if (string.IsNullOrEmpty(SearchCondition._keyword) == false) { BulletinBoardEventManager.Instance._keyword = SearchCondition._keyword; } } new BoardListApi ( AppStartLoadBalanceManager._userKey, BulletinBoardEventManager.Instance._CategoryID, BulletinBoardEventManager.Instance._lat, BulletinBoardEventManager.Instance._lng, BulletinBoardEventManager.Instance._sex, BulletinBoardEventManager.Instance._ageFrom, BulletinBoardEventManager.Instance._ageTo, BulletinBoardEventManager.Instance._heightFrom, BulletinBoardEventManager.Instance._heightTo, BulletinBoardEventManager.Instance._bodyType, BulletinBoardEventManager.Instance._isImage, BulletinBoardEventManager.Instance._radius, BulletinBoardEventManager.Instance._keyword, page_next.ToString() //EventManager.BulletinBoardEventManager.Instance._nowShowPage ); while (BoardListApi._success == false) { yield return(BoardListApi._success == true); } if (BoardListApi._httpCatchData.result.boards != null) { if (BoardListApi._httpCatchData.result.boards.Count > 0) { _boardListInfiniteLimitScroll.GetComponent <BoardListInfiniteLimitScroll> ().Init(); // 更新後のリストの位置にバーをあわせる if (ChangePage >= 0) { _boardListInfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.995f; } else { _boardListInfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.005f; } int page = int.Parse(EventManager.BulletinBoardEventManager.Instance._nowShowPage) + ChangePage; if (page % 2 == 0) { System.GC.Collect(); Resources.UnloadUnusedAssets(); } EventManager.BulletinBoardEventManager.Instance._nowShowPage = page.ToString(); } else { // リストのないページカウントになってるので 一旦通信とリストの更新をさせないようにする _disablePageForNetworkCall = true; _boardListInfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.995f; Debug.Log("存在しないページにアクセスしようとしたのでやめる"); } } else { _disablePageForNetworkCall = true; _boardListInfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.995f; Debug.Log("存在しないページにアクセスしようとしたのでやめる"); } _loadingOverlay.SetActive(false); }
/// <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; }
IEnumerator Init(int pageChange) { 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); } _loadingOverlay.SetActive(true); SearchEventManager.SearchCondition SearchCondition = LocalFileHandler.Load <SearchEventManager.SearchCondition>(LocalFileConstants.SEARCH_CONDITION_KEY); //条件検索のデータがローカルファイルに残っている場合。 if (SearchCondition != null) { SearchEventManager.Instance._lat = SearchCondition._lat; SearchEventManager.Instance._lng = SearchCondition._lng; SearchEventManager.Instance._order = SearchCondition._order; SearchEventManager.Instance._sex = SearchCondition._sex; SearchEventManager.Instance._ageFrom = SearchCondition._ageFrom; SearchEventManager.Instance._ageTo = SearchCondition._ageTo; SearchEventManager.Instance._heightFrom = SearchCondition._heightFrom; SearchEventManager.Instance._heightTo = SearchCondition._heightTo; SearchEventManager.Instance._bodyType = SearchCondition._bodyType; SearchEventManager.Instance._isImage = SearchCondition._isImage; SearchEventManager.Instance._radius = SearchCondition._radius; SearchEventManager.Instance._keyword = SearchCondition._keyword; } // 通信レスポンス待ってから UserListApi._success = false; int page_next = int.Parse(EventManager.SearchEventManager.Instance._nowShowPage) + pageChange; new UserListApi( AppStartLoadBalanceManager._userKey, SearchEventManager.Instance._lat, SearchEventManager.Instance._lng, SearchEventManager.Instance._order, SearchEventManager.Instance._sex, SearchEventManager.Instance._ageFrom, SearchEventManager.Instance._ageTo, SearchEventManager.Instance._heightFrom, SearchEventManager.Instance._heightTo, SearchEventManager.Instance._bodyType, SearchEventManager.Instance._isImage, SearchEventManager.Instance._radius, SearchEventManager.Instance._keyword, page_next.ToString() //EventManager.SearchEventManager.Instance._nowShowPage ); while (UserListApi._success == false) { yield return(UserListApi._success == true); } SearchEventManager.SearchCondition condition = new SearchEventManager.SearchCondition(); condition._lat = SearchEventManager.Instance._lat; condition._lng = SearchEventManager.Instance._lng; condition._order = SearchEventManager.Instance._order; condition._sex = SearchEventManager.Instance._sex; condition._ageFrom = SearchEventManager.Instance._ageFrom; condition._ageTo = SearchEventManager.Instance._ageTo; condition._heightFrom = SearchEventManager.Instance._heightFrom; condition._heightTo = SearchEventManager.Instance._heightTo; condition._bodyType = SearchEventManager.Instance._bodyType; condition._isImage = SearchEventManager.Instance._isImage; condition._radius = SearchEventManager.Instance._radius; condition._keyword = SearchEventManager.Instance._keyword; LocalFileHandler.Save <SearchEventManager.SearchCondition>(LocalFileConstants.SEARCH_CONDITION_KEY, condition); LocalFileHandler.Flush(); if (UserListApi._httpCatchData.result.users != null) { if (UserListApi._httpCatchData.result.users.Count > 0) { _InfiniteLimitScroll.GetComponent <SearchListLargeImageInfiniteLimitScroll> ().Init(); // 更新後のリストの位置にバーをあわせる if (pageChange >= 0) { _InfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.995f; } else { _InfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.005f; } int page = int.Parse(SearchEventManager.Instance._nowShowPage) + pageChange; if (page % 4 == 0) { System.GC.Collect(); Resources.UnloadUnusedAssets(); } SearchEventManager.Instance._nowShowPage = page.ToString(); } else { // リストのないページカウントになってるので 一旦通信とリストの更新をさせないようにする _disablePageForNetworkCall = true; _InfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.995f; Debug.Log("存在しないページにアクセスしようとしたのでやめる"); //_InfiniteLimitScroll.GetComponent<SearchListLargeImageInfiniteLimitScroll> ().SetPanelMax(0); //_InfiniteLimitScroll.GetComponent<SearchListLargeImageInfiniteLimitScroll> ().SetPanelInstantateCount(0); } } else { _disablePageForNetworkCall = true; _InfiniteLimitScrollBar.GetComponent <Scrollbar> ().value = 0.995f; Debug.Log("存在しないページにアクセスしようとしたのでやめる"); //_InfiniteLimitScroll.GetComponent<SearchListLargeImageInfiniteLimitScroll> ().SetPanelMax(0); //_InfiniteLimitScroll.GetComponent<SearchListLargeImageInfiniteLimitScroll> ().SetPanelInstantateCount(0); } _loadingOverlay.SetActive(false); }