Exemple #1
0
    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();
    }
Exemple #2
0
    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);
        }
    }
Exemple #3
0
    public void RetrieveChachedVideos()
    {
        CachedVideos data = SaveSystem.LoadVideos();

        games = data.games;
    }
Exemple #4
0
 public CachedVideos(CachedVideos incoming)
 {
     this.games = incoming.games;
 }