DataPersistenceConfig
Last updated
Last updated
The DataPersistenceConfig
is a configuration object used to manage settings related to data persistence operations in the Tarsave system. It contains essential settings like encryption and compression, which control how data is handled during save, load, and delete operations.
Configuration Options:
Encryption: This setting determines whether the data should be encrypted before saving. If enabled, the system will use the specified encryption method (e.g., AES encryption) to ensure the data is securely stored.
Compression: This setting controls whether the data should be compressed before being saved. If enabled, the data will be compressed to reduce its size, optimizing storage and transfer.
Access and Creation: The DataPersistenceConfig object can be created in two ways:
Via ScriptableObject.CreateInstance:
The DataPersistenceConfig can be created at runtime using ScriptableObject.CreateInstance<DataPersistenceConfig>()
. This method allows dynamic creation of the configuration during execution.
Via Unity’s AssetMenu:
The DataPersistenceConfig
can also be created through Unity’s AssetMenu for easy management within the Unity Editor. It is available under Tarsave/DataPersistenceConfig, and can be created directly in the Assets folder. This is useful for defining reusable configuration settings and makes it easier to manage configurations across different parts of your project.
Once created, the DataPersistenceConfig
can be assigned to the DataPersistenceBuilder
to control the data persistence behavior.