public interface IPersistentStateManager
Represents a persistent state manager contract. You can create a class that implements this to control how data related to the Streamable Assets Manager is saved and loaded. This is used with the Component Manager's Save and Load methods.
Name | Type | Description |
---|---|---|
DisableAutoInvocationOfBeforeAndAfterLoadMethods | bool |
By default, when the Component Manager's Load method is called, it will automatically
call
OnBeforeDataLoaded before calling the Load... methods, and then it will automatically
call OnAfterDataLoaded
after all data has been loaded. In some instances, this may be undesirable, for instance
if you want to
load non Streamable Assets Manager data before or after the Component Manager's Load
method is called.
|
DisableAutoInvocationOfBeforeAndAfterSaveMethods | bool |
By default, when the Component Manager's Save or ConvetOldData methods are called,
those methods will
automatically call the OnBeforeDataSaved and OnAfterDataSaved methods before/after
saving the data is saved.
In some instances, this may be undesirable, for instance if you want to
save non Streamable Assets Manager data before or after the Component Manager's Save
method is called.
|
bool LoadBool()
Loads a boolean value.
bool
The loaded boolean.
double LoadDouble()
Loads a double value.
double
The loaded double.
float LoadFloat()
Loads a float value.
float
The loaded float.
int LoadInt()
Loads an integer value.
int
The loaded integer.
string LoadString()
Loads a string value.
string
The loaded string.
void OnAfterDataLoaded()
If DisableAutoInvocationOfBeforeAndAfterLoadMethods is implemented to return false,
this method will be
called automatically by the Component Manager after it completes the loading process
(when its Load method is called).
This can be used to cleanup/finalize/close streams and other data, such as a file
sream or binary writer.
If DisableAutoInvocationOfBeforeAndAfterLoadMethods is implemented to return true,
you will need to manually call this method
after completing the load operation. Usually, you would only do this if you have non
Streamable Assets Manager data you wish to
load using the IPersistentStateManager.
void OnAfterDataSaved()
If DisableAutoInvocationOfBeforeAndAfterSaveMethods is implemented to return false,
this method will be
called automatically by the Component Manager after it finishes the saving process
(when its Save and ConvertOldSaveData methods are called).
This can be used to cleanup/finalize/close streams and other data, such as a file
sream or binary writer.
If DisableAutoInvocationOfBeforeAndAfterSaveMethods is implemented to return true,
you will need to manually call this method
after completing the save operation. Usually, you would only do this if you have non
Streamable Assets Manager data you wish to
save using the IPersistentStateManager.
void OnBeforeDataLoaded()
If DisableAutoInvocationOfBeforeAndAfterLoadMethods is implemented to return false,
this method will be
called automatically by the Component Manager before it starts the loading process
(when its Load method is called).
This can be used to setup anything needed
to actually perform the load operations, such as a file sream or binary writer.
If DisableAutoInvocationOfBeforeAndAfterLoadMethods is implemented to return true,
you will need to manually call this method
before beginning the load operation. Usually, you would only do this if you have non
Streamable Assets Manager data you wish to
load using the IPersistentStateManager.
void OnBeforeDataSaved()
If DisableAutoInvocationOfBeforeAndAfterSaveMethods is implemented to return false,
this method will be
called automatically by the Component Manager before it starts the saving process
(when its Save or ConvertOldSaveData methods are called).
This can be used to setup anything needed
to actually perform the save operations, such as a file streams or binary writers.
If DisableAutoInvocationOfBeforeAndAfterSaveMethods is implemented to return true,
you will need to manually call this method
before beginning the save operation. Usually, you would only do this if you have non
Streamable Assets Manager data you wish to
save using the IPersistentStateManager.
void SaveBool(bool value)
Saves an boolean value.
Name | Type | Description |
---|---|---|
value | bool |
The bool to save. |
void SaveDouble(double value)
Saves a double value.
Name | Type | Description |
---|---|---|
value | double |
The double to save. |
void SaveFloat(float value)
Saves a float/single value.
Name | Type | Description |
---|---|---|
value | float |
The float to save. |
void SaveInt(int value)
Saves an integer value.
Name | Type | Description |
---|---|---|
value | int |
The integer to save. |
void SaveString(string value)
Saves an string value.
Name | Type | Description |
---|---|---|
value | string |
The string to save. |