Esempio n. 1
0
        public static void RewriteFileContent(string fileName, object data, FolderPaths path)
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = System.IO.File.Open(UnityFile.GetFolderPath(path) + "/" + fileName, FileMode.OpenOrCreate);

            bf.Serialize(file, data);
            file.Close();
        }
Esempio n. 2
0
        public static object GetFileContent(string fileName, FolderPaths path)
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = System.IO.File.Open(UnityFile.GetFolderPath(path) + "/" + fileName, FileMode.OpenOrCreate);

            var data = bf.Deserialize(file);

            file.Close();
            return(data);
        }
Esempio n. 3
0
 public static bool Exists(string fileName, FolderPaths path)
 {
     return(System.IO.File.Exists(UnityFile.GetFolderPath(path) + "/" + fileName));
 }