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(); }
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); }
public static bool Exists(string fileName, FolderPaths path) { return(System.IO.File.Exists(UnityFile.GetFolderPath(path) + "/" + fileName)); }