Ejemplo n.º 1
0
    void LoadSavePoint()
    {
        BinaryFormatter         bf   = new BinaryFormatter();
        FileStream              file = File.Open(Application.dataPath + "/SaveGameAtSavePoint.dat", FileMode.Open);
        SaveDataFromPlayerStats data = (SaveDataFromPlayerStats)bf.Deserialize(file);

        file.Close();
        loreListFromSave = data.loreList;
        NewMonsterList   = new GameObject[loreListFromSave.Count];
    }
Ejemplo n.º 2
0
    public void LoadGameAtSavePoint()
    {
        if (File.Exists(Application.dataPath + "/SaveGameAtSavePoint.dat"))
        {
            BinaryFormatter         bf   = new BinaryFormatter();
            FileStream              file = File.Open(Application.dataPath + "/SaveGameAtSavePoint.dat", FileMode.Open);
            SaveDataFromPlayerStats data = (SaveDataFromPlayerStats)bf.Deserialize(file);
            file.Close();

            sceneToLoad = data.currentLevel;           //get the saved scene;
            LoadingScreenLogic.sceneName = sceneToLoad;
            useSaveDataAtSavePoint       = true;       //set this so that when the scene is loaded use the save file
            ChangeLevel("LoadingScreen");
        }
    }