Saving and Loading from Resources

Resources allows you to include and load files which will be included at runtime, including Easy Save 2 save files.

Easy Save can only save to the Resources folder from inside the Editor as the Resources folder doesn’t exist when your Unity application gets built.

If you want to save data to Resources with the intention of loading later, any files must end in the extension .bytes.

Because ES2.Save accepts an absolute path, we can use Application.dataPath to get the absolute path to our Assets folder, and then add to the end of that the path to our Resources folder.

Alternatively, you can save data to a folder of your choice and then drag it into the Resources folder.

Also note that if you want files to be visible immediately in Unity after creating them, you will need to call AssetDatabase.Refresh(), or refresh the assets from within Unity.

C#

JS

To Load from Resources, you must set your Save Location to Resources. You can do this using Parameters, or using an ES2Settings object.

Note that unlike saving, we don’t have to provide the path to the Resources folder.

C#

JS