using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
public class saveLoad {
public static List<GameInfoDataBase> SavedGames = new List<GameInfoDataBase>();
public static void Save() {
saveLoad.SavedGames.Add(GameInfoDataBase.GameDB);
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Create(Application.persistentDataPath + "/Data.NissYokuGames");
bf.Serialize(file, saveLoad.SavedGames);
file.Close();
Debug.Log(Application.persistentDataPath);
}
public static void Load() {
if (File.Exists(Application.persistentDataPath + "/Data.NissYokuGames")) {
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Open(Application.persistentDataPath + "/Data.NissYokuGames", FileMode.Open);
saveLoad.SavedGames = (List<GameInfoDataBase>)bf.Deserialize(file);
file.Close();
Debug.Log(SavedGames.Count);
Debug.Log(Application.persistentDataPath);
}
}
}
for(int i = 0; i < saveLoad.SavedGames.Count; i++)
{
//additional code here..
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games
or check out the face book page here https://www.facebook.com/ForeLoreGames
: ) Just to complete the thread. You didn't mark your thread Solved. : )
Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games
or check out the face book page here https://www.facebook.com/ForeLoreGames