IEnumerator MsgBox_ShowErrorList(string err) { MessageBox.Show(LocaleManager.instance.GetLocaleText("selectsong_errorlisthead"), LocaleManager.instance.GetLocaleText("selectsong_errorlist1") + err + LocaleManager.instance.GetLocaleText("selectsong_errorlist2"), MessageBoxButton.YesNo); yield return(new WaitUntil(() => MessageBox.Instance.ResultExists == true)); if (MessageBox.Instance.Result.Equals(MessageBoxButtonType.Yes)) { ErrorInfo.SetActive(false); ErrorDirList.Clear(); SearchLoad(searchTexts); } }
public void SearchLoad(Text searchText) { string value = searchText.text; lastButtonIdx = -1; if (buttons.Count > 0) { for (int i = 0; i < buttons.Count; i++) { buttons[i].SetActive(false); } buttons.Clear(); } DirectoryInfo source = new DirectoryInfo(GamePath.SongPath()); DirectoryInfo[] dir = source.GetDirectories(); if (dir.Length.Equals(0)) { ErrorManager.showErrorText(errorText.gameObject, ErrorMode.NoSong); return; } List <string> list = new List <string>(); for (int i = 0; i < dir.Length; i++) { list.Add(dir[i].Name); } list.Sort(); int chk; // 악곡 데이터가 정상적으로 입력되었는지를 알려주는 값. foreach (string dat in list) { GameObject go = Instantiate(listButton) as GameObject; go.SetActive(true); SongButton realBtn = go.GetComponent <SongButton>(); chk = realBtn.SetSongName(dat, source.FullName + dat, value); //chk = realBtn.SetSong(dat, source.FullName + dat, value); // 이거를 버튼 눌렀을 때로도 뺀다. realBtn.Index = buttons.Count; if (chk.Equals(1)) { go.SetActive(false); continue; } else if (chk.Equals(-1)) { if (!ErrorInfo.activeSelf) { ErrorInfo.SetActive(true); } ErrorDirList.Add(dat); } //여기까지 go.transform.SetParent(listButton.transform.parent); go.transform.localScale = new Vector3(1, 1, 1); // 해상도에 따른 조정 buttons.Add(go); } if (buttons.Count >= 30 && !ErrorInfo.activeSelf) { #if UNITY_ANDROID if (Social.localUser.authenticated) { PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_pride_of_the_rich, 100.0f, null); } #elif UNITY_IOS Achievementer.ReportProgress("prideoftherich"); #endif } }