📪TimeTrialSaveManager
Component
Last updated
Component
Last updated
This component can be added to your project to ensure that player personal best lap times set by the LapTimeTrackingObject are persistent across game sessions. It is a singleton that provides saving/loading functionality by calling the SaveDatatoJson
and LoadDataFromJson
methods.
This component makes use of a serializable TimeTrialSaveData class that is used for converting time trial data to/from the JSON save file.
CAUTION: This save system is intended for testing/debugging purposes. It uses unencrypted JSON and lap times are easily modifiable by players.
The save file name is a string that can be set in inspector to specify a custom file name to save and load the JSON save file. If no name is provided, a default name is given for the JSON file based on the name of the GameObject that this component is attached to.
String of the actual path where the file is saved/loaded from. The path used by default is the Unity persistent data path with the save file name field and JSON file ending appended to the path.