NOTE: In Unity 2019, Windows Universal Platform builds use IL2CPP (not .NET) and can access the usual System.IO classes, rendering UnifiedIO obsolete unless you want to benefit from its convenience methods. UnifiedIO is still useful if you use an older Unity version with .NET builds.
Have you tried to build your game for the Windows Store and got dozens of errors with non-existent IO classes and methods? Don't want to write platform-specific code and deal with async calls and new syntax? Well, don't!
UnifiedIO is a library with common methods to operate on files/folders in Application.persistentDataPath, i.e. the data folder reserved for your game.
You can call a UnifiedIO method and expect it to compile and work on Windows, Mac OS X, Linux, Blackberry, Android, iOS, Windows Phone and Windows Store Apps (Windows 8, 8.1, 10, Universal) without any extra coding.
Just add UnifiedIO to your project and start using its methods! You can also use it to cover only IO for Windows Store builds and retain your existing code, if you wish. You can also change its working directory to a custom one for each platform, if you have more advanced requirements.
What follows is a list of UnifiedIO methods (documentation here):
UnifiedIO.Directory class:
bool Exists(string path)
void Create(string path)
void Rename(string path, string newName)
void Move(string path, string destinationPath)
void Copy(string path, string destinationPath)
void MoveInside(string path, string destinationPath)
void CopyInside(string path, string destinationPath)
void Delete(string path)
void DeleteContents(string path)
string[] GetFiles(string path, string searchPattern, SearchOption searchOption)
string[] GetDirectories(string path, string searchPattern, SearchOption searchOption)
UnifiedIO.File class:
bool Exists(string path)
void CreateEmpty(string path)
void Rename(string path, string newName)
void Move(string path, string destinationPath)
void Copy(string path, string destinationPath)
void MoveInside(string path, string destinationPath)
void CopyInside(string path, string destinationPath)
void Delete(string path)
Stream GetReadStream(string path)
Stream GetWriteStream(string path)
Stream GetAppendStream(string path)
byte[] ReadBytes(string path, int position = 0, int nBytes = 0)
void WriteBytes(string path, byte[] content)
void WriteBytes(string path, byte[] content, int position)
void AppendBytes(string path, byte[] content)
string ReadText(string path)
void WriteText(string path, string content)
void AppendText(string path, string content)
IList ReadLines(string path)
void WriteLines(string path, IEnumerable content)
void AppendLines(string path, IEnumerable content)
UnifiedIO supports Unity version 4.2.0 onwards (Free and Pro), including Unity 5, and is programmed in C#. If you use UnityScript, you can still use UnifiedIO, but please read the documentation for details.
All methods were consistently unit-tested, though I'd love to hear from you if you've found a bug or have suggestions. Contact me here or in the forum. Leave a review if you can! Good or bad; developers need feedback! :)
Documentation
Unity Forum Thread