Interface IDataPersistence
Interface for defining load and save methods for persistence.
Namespace: UnityEngine.GameFoundation.DataPersistence
Syntax
public interface IDataPersistence
Methods
Load(Action<GameFoundationSerializableData>, Action<Exception>)
Asynchronously loads GameFoundation's data from the persistence layer.
Declaration
void Load(Action<GameFoundationSerializableData> onLoadCompleted = null, Action<Exception> onLoadFailed = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GameFoundationSerializableData> | onLoadCompleted | Called with the loaded data when they have been successfully loaded. |
Action<Exception> | onLoadFailed | Called with a detailed exception when the loading failed. |
Save(GameFoundationSerializableData, Action, Action<Exception>)
Asynchronously saves GameFoundation's data onto the persistence layer.
Declaration
void Save(GameFoundationSerializableData content, Action onSaveCompleted = null, Action<Exception> onSaveFailed = null)
Parameters
Type | Name | Description |
---|---|---|
GameFoundationSerializableData | content | GameFoundation's data to persist. |
Action | onSaveCompleted | Called when data have been successfully saved. |
Action<Exception> | onSaveFailed | Called with a detailed exception when the save failed. |