The framework currently supports the saving and loading of games into game slots. The system currently support the following:

Saving the state of objects

Some object might require to have their current status saved. This includes activation state (isActive) and transform.

In order to achieve this, objects hold a SavableObjectState component and a ObjectUniqueId.

Untitled

The Unique Id will be regenerated when the field is empty. When the game is saved, all

Saving the state of Animators

SavableAnimator component can be added to an object with an Animator component to save the state of the Animator (current State and parameters)

Saving the state of Visual Scripting

SavableVariables component can be added to an object with a VisualScripting Variables component to save the state of the variables.

Saving the state of other components

In order for SavableObjectState to store extra information from components, the component will need to implement the ISavableObjectStateExtra interface, which will force you to implement two functions for serialization and deserialization of data as a string.

It’s up to the programmer to decide how to serialize this content. Data can be simply converted into a string for simple objects or, for more complex data, serialized into JSON and converted into a string.

Object Unique Ids

Unique Ids are used to identity the object when serializing and deserializing the saved data.

The system automatically assigns unique Ids to prefab instances when dropped in the level, but conflicts might arise if an object is duplicated in the level, in which case you will get an error similar to the one below.

Untitled