public void SaveData(int index, Image background) { _saveData = new SaveData(); _image.sprite = background.sprite; _saveData.backgroundName = background.name; _saveData.distractorHistory = GameDataManager.getInstance.DistractorToString(); _saveData.readCount = GameDataManager.getInstance.readCount; string path = string.Format("{0}/{1}.dat", Application.temporaryCachePath, GameDataManager.getInstance.savePath + index.ToString()); FileIOExtension.SaveAsFile(_saveData, path, path); }
public void Init() { for (int i = 0; i < 3; i++) { string path = string.Format("{0}/{1}.dat", Application.temporaryCachePath, GameDataManager.getInstance.savePath + i.ToString()); SaveData data = FileIOExtension.LoadFromFile <SaveData>(path, path); if (data != null) { _LoadBox[i].SetSaveData(data); } } }