Storage
Static helper to save and read files.
Example
using EODE.Wonderland;
// My game data
class MyData {
public string Pseudo;
public int Score;
}
var myData = Storage.ReadJsonFile<MyData>("myGameData");
if (myData == null) {
myData = new MyData() {
Pseudo = "Eroy",
Score = 9001
};
Storage.SaveJsonFile<MyData>("myGameData", myData);
}
Members
Location
Persistent data path
// Alias of
Path.Combine(Application.persistentDataPath, "Data")
CreateDirectory
Creates directory if not exist
GetFullPath
Combines Persistent data path with a path
DeleteFile
Deletes a file
DeleteDirectory
Deletes a directory
FileExists
Returns true if the file exist
DirectoryExists
Returns true if directory exist
Write
Writes a byte array in a file
ReadText
Extracts the string content of a file
ReadLines
Reads all lines of a file
ReadBytes
Reads all bytes of a file
ReadJsonFile
Read saved data
SaveJsonFile
Save data at json in storage