/// <summary> /// Loads the latest Save Point. /// </summary> public void LoadLatestSavePoint() { if (savePoints.Count > 0) { var savePointData = savePoints[savePoints.Count - 1]; SavePointData.Decode(savePointData); } }
/// <summary> /// Creates a new Save Point using a key and description, and adds it to the Save History. /// </summary> public void AddSavePoint(string savePointKey, string savePointDescription) { // Creating a new Save Point invalidates all rewound Save Points, so delete them. ClearRewoundSavePoints(); string sceneName = SceneManager.GetActiveScene().name; var savePointData = SavePointData.Encode(savePointKey, savePointDescription, sceneName); savePoints.Add(savePointData); }
protected static SavePointData Create(string _savePointKey, string _savePointDescription, string _sceneName) { var savePointData = new SavePointData(); savePointData.savePointKey = _savePointKey; savePointData.savePointDescription = _savePointDescription; savePointData.sceneName = _sceneName; return(savePointData); }