Exemple #1
0
    public void LoadLoadManager()
    {
        LoadManagerData loadManagerData = SaveSystem.LoadLoadManager();

        for (int i = 0; i <= loadManagerData.highestLevelUnlocked; i++)
        {
            loadManager.levelButtons[i].GetComponent <Button>().interactable = true;
            loadManager.levelScores[i] = loadManagerData.levelScores[i];
        }
    }
Exemple #2
0
    public static void SaveLoadManager(LoadManager loadManager)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/loadManager.save";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        LoadManagerData data = new LoadManagerData(loadManager);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Exemple #3
0
    public static LoadManagerData LoadLoadManager()
    {
        string path = Application.persistentDataPath + "/loadManager.save";

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);

            LoadManagerData data = formatter.Deserialize(stream) as LoadManagerData;
            stream.Close();

            return(data);
        }
        else
        {
            Debug.LogError("No Save File in: " + path);
            return(null);
        }
    }