示例#1
0
    public void saveData(GameSaveObject gameSaveObject)
    {
        string          folderPath      = Path.Combine(Application.persistentDataPath, dataFolderName);
        string          dataPath        = Path.Combine(folderPath, dataSaveName + fileExtension);
        BinaryFormatter binaryFormatter = new BinaryFormatter();

        using (FileStream fileStream = File.Open(dataPath, FileMode.Create)) {
            binaryFormatter.Serialize(fileStream, gameSaveObject);
        }
    }
示例#2
0
    public void saveData()
    {
        var gameSaveObject = new GameSaveObject(ResearchController.instance.getResearchTreeRoot().getResearchedItemsNames(), xp);

        SaveController.instance.saveData(gameSaveObject);
    }