private DefaultGameData.Default_UserData userSet() { //나중에 바꿔야됨 DefaultGameData.Default_UserData userData = new DefaultGameData.Default_UserData(20, 0.01f, 0.01f, 2, 100, 10, 100, 10); // return(userData); }
private void SaveData_2() { string basicPath = Application.dataPath; Debug.Log("SaveData_2"); // user DefaultGameData.Default_UserData testUser = userSet(); // unit List <DefaultGameData.Default_MinionData> testObj = unitSet(); // item List <DefaultGameData.Default_ItemData> testItem = itemSet(); // skill List <DefaultGameData.Default_SkillData> testSkill = skillSet(); // minion skill List <DefaultGameData.Default_MinionSkillData> testMinionSkill = minionSkillSet(); // lv exp DefaultGameData.LvExpManager lvManager = expManagerSet(); BinaryFormatter bf = new BinaryFormatter(); using (FileStream fs = new FileStream(basicPath + DataPath.defaultUserDataPath, FileMode.OpenOrCreate)) { bf.Serialize(fs, testUser); } using (FileStream fs = new FileStream(basicPath + DataPath.defaultItemDataPath, FileMode.OpenOrCreate)) { bf.Serialize(fs, testItem); } using (FileStream fs = new FileStream(basicPath + DataPath.defaultSkillDataPath, FileMode.OpenOrCreate)) { bf.Serialize(fs, testSkill); } using (FileStream fs = new FileStream(basicPath + DataPath.defaultMinionSkillPath, FileMode.OpenOrCreate)) { bf.Serialize(fs, testMinionSkill); } using (FileStream fs = new FileStream(basicPath + DataPath.defaultMinionDataPath, FileMode.OpenOrCreate)) { bf.Serialize(fs, testObj); } using (FileStream fs = new FileStream(basicPath + DataPath.defaultExpManagerPath, FileMode.OpenOrCreate)) { bf.Serialize(fs, lvManager); } }