public static void SaveVideoForLaterUpload(CachedVideos videosToUpload) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/cachedvideos.txt"; FileStream stream = new FileStream(path, FileMode.Create); CachedVideos data = new CachedVideos(videosToUpload); formatter.Serialize(stream, data); stream.Close(); }
public static CachedVideos LoadVideos() { string path = Application.persistentDataPath + "/cachedvideos.txt"; if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Open); CachedVideos data = formatter.Deserialize(stream) as CachedVideos; stream.Close(); return(data); } else { Debug.LogError("File does not exists in " + path); //return default settings? CachedVideos data = new CachedVideos(); return(data); } }
public void RetrieveChachedVideos() { CachedVideos data = SaveSystem.LoadVideos(); games = data.games; }
public CachedVideos(CachedVideos incoming) { this.games = incoming.games; }