Saving
This section outlines the step-by-step process of saving data using ESave.
1. Loading the Save State
The first step to saving data is loading the save state. You will need a save state ID. See Save States for more information.
This method returns a Save Operation (result type: SaveState
).
2. Saving Data
Each piece of data in a save state has an ID (string). This makes it possible to retrieve specific data by ID.
Saving data can be done with a single line with the AddData
method.
The first parameter is the ID of the data, and the second parameter is the data itself. Any serializable data type can be saved. However, most Unity types are not savable. ESave can save common Unity data types, including (but not limited to) Vector2
, Vector3
, Quaternion
, Color
, Transform
, and RectTransform
.
This method returns a Save Operation (result type: bool
).
3. Save Confirmation
The ESave.Save
method finalizes all changes made to a save state. It should not be called after every AddData
operation. Instead, it should only be used when the game needs to save progress to a specific save state—typically when the player manually saves through the save menu by overwriting an existing save or creating a new one.
In other words, this method should be used minimally and only when necessary. See Save States for more information.
This method returns a Save Operation (result type: SaveState
).
Last updated