Persistent Data Controllers are no longer used within the Streamable Assets Manager, as a new save/load system has been introduced that offers a greater amount of flexibility. This new system is based on the IPersistentStateManager interface, which is a new interface you can implement to comply with the save/load requirements of the Streamable Assets Manager. Alternatively, you can use the provided Binary Serializer Persistent State Manager, which provides an implementation of the IPersistentStateManager interface using binary serialization (a binary reader/writer to be more specific).
The intent behind the IPersistentStateManager interface is to allow you to integrate the save/load requirements of SAM into your existing save/load solution while also eliminating garbage generation for save operations.
With that said, if you have already deployed a Game using the old Persistent Data Controller based system, or for any other reason need to be able to load data saved using a Persistent Data Controller, we have you covered! The data saved using the PersistentDataController class can be converted into the new Persistent State Manager format, however you will still need to create new Persistent Data Controller classes for each of your custom Persistent Data Controllers, under the new DeepSpaceLabs.SAM namespace.
Once you finish creating new Persistent Data Controllers using the information found in this Section, you can convert your old save data using the ComponentManager's static ConvertOldSavedata method. More information about using this method can be found in the Saving And Loading Data Section within the Component Managers Chapter, however we recommend completing this Section and conversion of your old Persistent Data Controllers before moving onto converting your old data.
--Special Note--
It is recommended to create new Persistent Data Controller classes rather than modifying your existing classes. This will ensure you can still access the data from existing components and can save them in case something goes wrong with the upgraded classes.
Because this component is not generally used by SAM, it's make up is exactly the same as before with one small addition. As such, you can simply copy all settings from your old Persistent Data Controller's to your new Persistent Data Controllers.
A new method was added to the base PersistentDataController class, and you will need to provide an override for it. This new method should simply return a value indicating whether data exist for a specific key. This method is necessary for the new static ComponentManager.DoesOldPersistentDataControllerDataExist method to function correctly, which you can utilize in order to determine if old persistent data controller data exist that needs to be converted to the new persistent state manager system.
In order to load data with the Persistent Data Controller, it's necessary to manually convert the data using the ConvertOldSaveData method of the Component Manager, specifically the method that has a PersistentDataController parameter.
--Special Note--
Conversion only needs to happen once for each save data, so after a successful conversion you should delete the old data. Use the ComponentManager.DoesOldPersistentDataControllerDataExist method to determine if data exist that needs to be converted.
Once you have your Controller setup and a mechanism in place for converting its data, we invite you to explore the new Persistent State Manager save/load solution to understand how the replacement for the Controller will work.