Important: Auto Save is currently in beta, and as such certain features (such as saving collections, references and null references) are disabled. If using this beta in a product, please ensure that you test it thoroughly before release! While in beta, it is provided without warranty.
Auto Save is a visual scripting tool for the Unity 5 Editor which allows you to save and load data without any programming.
It can save Components, Variables and even references to Prefabs.
Auto Saving Scene Objects
To enable Auto Save for your scene:
- Go to Window > Easy Save 2 > Auto Save > Scene
- Press the ‘Click to enable Auto Save for this scene’ button.
This will reveal the visual scripting tool, which displays your scene hierarchy in a list. Click the name of an object or variable and it will show it’s instance variables.
Beside each of these is a icon, which allows you to tell Auto Save to save and load it. Click the icon and it will become highlighted (), showing that it will be auto saved.
Auto Saving Prefabs
It’s also possible to auto save prefabs, which will automatically be instantiated when loading.
To auto save prefabs, right-click them in the Project hierarchy and select Easy Save 2 > Enable Auto Save for Prefab(s).
You can then access these prefabs,and their children, using the Auto Save window, underneath the Prefabs tab.
Auto Save’s Settings
The Settings tab in the Auto Save window lets you choose a variety of options. Here’s a summary of the main options:
This allows you to choose when to save and load, and corresponds to Unity’s Event Functions.
It’s recommended to load on Start on all platforms, to save on On Application Pause on mobile platforms, and On Application Quit on all non-mobile platforms.
This is a relative or absolute path to a file which will be created to store our Auto Save data. See the Paths guide for more information.
A tag allows us to uniquely identify this Auto Save data in a file which might contain many different groups of Auto Save data.
For example, if you plan to enable Auto Save in two different scenes which save to the same file, you should use a different tag for each scene. Alternatively, you can set a different filename for each scene.
Manually triggering Auto Save
Sometimes you might want to trigger Auto Save using a button, or in your own event. No problem!
Simply find the ES2 Auto Save Manager script attached to the ES2 Auto Save Manager object, and call it’s Save() and Load() methods.
The easiest way to get the ES2 Auto Save Manager in code is as follows:
ES2AutoSaveManager mgr = GameObject.Find("ES2 Auto Save Manager").GetComponent<ES2AutoSaveManager>();
When doing this, you may also want to set the Save and Load events in the settings to None so that the game is only auto saved when you manually trigger it.
Known Beta Issues
- Sometimes the selection in Auto Save / Prefabs is not saved when quitting Unity in Unity 5.3.3f1.
- Bug at Unity’s end. Use 5.3.2f1 or below instead, or wait for Unity’s fix.