Paths and Locations

Easy Save supports relative and absolute paths. If a file or directory does not exist, it will be created.

Relative Paths

Relative paths will be relative to the storage location. For example:

C#

JS

Absolute Paths

Absolute paths are also accepted. However, it is not recommended to use absolute paths unless you are certain the location will exist at runtime and has the required permissions.

If you need to get an absolute path to a special folder at runtime, you can use .NET’s Environment.GetFolderPath method.

C#

JS

You can specify the storage location in the default settings, or by providing an ES3Settings object as a parameter.

File

Stores data to a file in the file system.

The default file directory is Unity’s Application.persistentDataPath, which you can get the precise location of using Debug.Log(Application.persistentDataPath).

You also have the option of using Application.dataPath by changing the ES3Settings.directory variable to ES3.Directory.DataPath, but is only guaranteed to be writable from the Editor.

File is not supported on WebGL, and will automatically default to PlayerPrefs regardless of what the location is set to.

PlayerPrefs

Stores data in Unity’s PlayerPrefs, which usually stores data in the registry or Isolated Storage.

This is provided for platforms such as WebGL which do not support saving to file, but rarely should you need to manually set your save location to PlayerPrefs.

On WebGL, PlayerPrefs has a 1MB limit.

Resources

For information on the Resources location, see the Saving and Loading from Resources guide.

Memory

The memory save location can only be used in special cases, such as with an ES3File.