Saving and Loading from File

Easy Save allows you to save and load from file. By default this file will be created in Application.persistentDataPath as this is guaranteed to exist. However, you may also supply Easy Save with an absolute path to save elsewhere.

You cannot save to file with Unity Web Player, so Easy Save instead automatically saves to PlayerPrefs, even if you give it a filename or an absolute path.

To save and load from file, simply provide a filename as the path. You may also specify a folder, which will be automatically created if it doesn’t exist.

You may use any extension for the file, as long as the target operating system allows it. We mostly use ‘.txt’ in our examples.

C#

JS

An absolute path must begin with either a drive letter (for example: C:/) or a slash (/). Using either forward or backslashes should be acceptable, depending on your target operating system.

You must ensure that the location of the absolute path will exist at runtime, and that you have the security credentials to write there. We always advise that you only use absolute paths when necessary.

C#

JS