Example #1
0
 /// <summary>
 /// Loads the latest Save Point.
 /// </summary>
 public void LoadLatestSavePoint()
 {
     if (savePoints.Count > 0)
     {
         var savePointData = savePoints[savePoints.Count - 1];
         SavePointData.Decode(savePointData);
     }
 }
Example #2
0
 public void LoadSpecificSavePoint(string savePointKey)
 {
     if (savePoints.Count > 0)
     {
         int index         = savePoints.IndexOf(savePointKey);
         var savePointData = savePoints[index];
         SavePointData.Decode(savePointData);
     }
 }
Example #3
0
        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;
        }
Example #4
0
        /// <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);
        }
Example #5
0
        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);
        }