//가챠 데이터 로드 public IEnumerator LoadGachaData() { gachaDataDic.Clear(); TextAsset textAsset = Resources.Load <TextAsset>("Data/GachaData"); string gachaData = ""; if (textAsset != null) { using (StreamReader streamReader = new StreamReader(new MemoryStream(textAsset.bytes))) { gachaData = streamReader.ReadToEnd(); streamReader.Close(); } } if (string.IsNullOrEmpty(gachaData)) { yield break; } List <GachaData> gachaDataList = new List <GachaData>(); using (StringReader sr = new StringReader(gachaData)) { string readLine; while ((readLine = sr.ReadLine()) != null) { if (!readLine.StartsWith("\t")) { string[] word = readLine.Split('\t'); gachaDataList.Add(new GachaData(word)); } } } int nationCount = System.Enum.GetNames(typeof(GirlGlobeEnums.eNation)).Length; //1 = 튜토리얼 챕터라 2부터 시작 for (int i = 2; i < nationCount + 1; i++) { List <GachaData> tempList = new List <GachaData>(); for (int j = 0; j < gachaDataList.Count; j++) { if (i == gachaDataList[j].nation_id) { tempList.Add(gachaDataList[j]); } } gachaDataDic.Add(i, tempList); } yield return(YieldReturnManager.waitForEndOfFrame()); }
//의상 세트 클라이언트용 데이터 로드 public IEnumerator LoadWearSetUIData() { wearSetUIDataList.Clear(); for (int i = 0; i < wearSetDataList.Count; i++) { wearSetUIDataList.Add(new WearSetUIData()); } yield return(YieldReturnManager.waitForEndOfFrame()); }
//언어 데이터 로드 public IEnumerator LoadLanguageData() { languageStringDic.Clear(); TextAsset textAsset = Resources.Load <TextAsset>("Data/LanguageData"); string languageData = ""; if (textAsset != null) { using (StreamReader streamReader = new StreamReader(new MemoryStream(textAsset.bytes))) { languageData = streamReader.ReadToEnd(); streamReader.Close(); } } if (string.IsNullOrEmpty(languageData)) { yield break; } using (StringReader sr = new StringReader(languageData)) { string readLine; while ((readLine = sr.ReadLine()) != null) { if (!readLine.StartsWith("\t")) { string[] word = readLine.Split('\t'); string key = word[0]; string text = word[( int )ProjectManager.Instance.language]; text = text.Replace("/n", "\n"); text = text.Trim(); if (languageStringDic.ContainsKey(key) == false) { languageStringDic.Add(key, text); } } } } yield return(YieldReturnManager.waitForEndOfFrame()); }
//챕터 스테이지 데이터 로드 public IEnumerator LoadChapterStageData() { chapterStageDataList.Clear(); TextAsset textAsset = Resources.Load <TextAsset>("Data/ChapterStageData"); string chapterStageData = ""; if (textAsset != null) { using (StreamReader streamReader = new StreamReader(new MemoryStream(textAsset.bytes))) { chapterStageData = streamReader.ReadToEnd(); streamReader.Close(); } } if (string.IsNullOrEmpty(chapterStageData)) { yield break; } using (StringReader sr = new StringReader(chapterStageData)) { string readLine; while ((readLine = sr.ReadLine()) != null) { if (!readLine.StartsWith("\t")) { string[] word = readLine.Split('\t'); chapterStageDataList.Add(new ChapterStageData(word)); } } } yield return(YieldReturnManager.waitForEndOfFrame()); }