Saving / Loading
| Saving and Loading is currently INCUBATING. A.t.m it only works in the editor, not in a built product. |
| Loading a saved game must happen with the exact same underlying database state as it was saved, else the results are unpredictable. |
Persistence mechanism
| The principle of saving/loading in TBE is that we are creating a separate class for everything that we want to save/load. This means we are creating our own serialization layer between our unity runtime data of the current scene and the final serialization (which then can happen by using JSON or something similar). |
The namespace tbe.incubator.save contains the TBE serialization layer and provides an infrastructure for using and enhancing TBE serialization with you own needs.
The idea is that the user extends the classes that start with the Simple* prefix. Those classes being:
-
SimpleSaveGameRuntimeData-
This class merely provides shortcuts to the runtime data that we want to save.
-
-
SimpleCreateSaveBhv-
This actually creates our save game.
-
-
SimpleSaveGame-
A value object that holds the save game data to be written to the save file.
-
-
SimpleLoadGameBhv-
This loads our save game.
-