public IEnumerator LoadData_ChildList() { yield return(StartCoroutine(CreatePath(eDataType.CHILD, currentDataSlot))); string path = currentFilePath; yield return(StartCoroutine(fileManager.ReadText(childFileName, path))); if (!string.IsNullOrEmpty(fileManager.readText_Result)) { var loadedData = JsonUtility.FromJson <Data_ChildList>(fileManager.readText_Result); currentData_ChildList = loadedData; //ApplySettings(loadedData); } }
//테스트용 세이브. public IEnumerator TestSave() { yield return(StartCoroutine(CreatePath(eDataType.CHILD, currentDataSlot))); isLoad = false; //원래라면 딕셔너리로 작업된 녀석들을 DictToList로 변환시켜야합니다. currentData_ChildList = new Data_ChildList(); currentData_ChildList.childDataList = new List <Data_Child>(); currentData_ChildList.childDataList.Clear(); currentData_Child = new Data_Child(); currentData_Child.currentStage = 1; currentData_Child.currentPosition = new Vector3(0, 0, 0); currentData_Child.isDie = false; currentData_Child.isFriend = false; currentData_Child.isBye = false; currentData_Child.name = "코라"; currentData_Child.age = "10살"; currentData_Child.diaryData = "아앙, 테메와 돈독한 친구사이같다..."; currentData_Child.childType = eChildType.KORA; currentData_ChildList.childDataList.Add(currentData_Child); Data_Child tempData = new Data_Child(currentData_Child); tempData.name = "테메"; tempData.diaryData = "코라를 좋아하고 있는 듯 하다..."; tempData.age = "9살"; tempData.childType = eChildType.TEME; currentData_Child = tempData; currentData_ChildList.childDataList.Add(currentData_Child); currentData_Child = null; yield return(StartCoroutine(SaveData_ChildList())); ListToDictionary(); Debug.Log("Save Finish!"); yield break; }