コード例 #1
0
ファイル: SaveLoad.cs プロジェクト: troseberry/dotsgame
    public static void Save()
    {
        BinaryFormatter data = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/gameSave.dat");

        SaveableData saveData = new SaveableData();

        //-----------------------Saving Data---------------------------------------------
        Hashtable dataToSave = new Hashtable();

        dataToSave.Add("finishedTutorial", CampaignData.GetFinishedTutorial());
        dataToSave.Add("viewedAbilityMatchInstructions", CampaignData.ViewedMatchAbilityInstructions());
        dataToSave.Add("allBoardLevels", CampaignData.GetAllLevelsDictionary());
        dataToSave.Add("heroesUnlocked", CampaignData.GetAllHeroBoardsDictionary());
        dataToSave.Add("boardStarCounts", CampaignData.GetAllBoardStarCounts());

        //-----------------------Done Saving---------------------------------------------
        data.Serialize(file, dataToSave);
        file.Close();
        //Debug.Log("Saved here: " + Application.persistentDataPath);
    }