Loading...
Searching...
No Matches
PixelCrushers.SavedGameData Class Reference

Holds the data for a saved game. More...

Inheritance diagram for PixelCrushers.SavedGameData:
Collaboration diagram for PixelCrushers.SavedGameData:

Classes

class  SaveRecord
 Holds the data returned by a Saver along with the Saver's key and the index of the scene that the Saver was in. More...
 

Public Member Functions

void OnBeforeSerialize ()
 
void OnAfterDeserialize ()
 
SaveRecord GetDataInfo (string key)
 Retrieves info about the previously-saved data for a Saver.
 
string GetData (string key)
 Retrieves the previously-saved data for a Saver.
 
void SetData (string key, int sceneIndex, string data)
 Stores a Saver's data.
 
void DeleteData (string key)
 Removes a Saver's data.
 
void DeleteObsoleteSaveData (int currentSceneIndex)
 Removes all save records except those in the current scene and those that are configured to remember across scene changes.
 

Properties

int version [get, set]
 The save file format version.
 
string sceneName [get, set]
 The scene in which the game was saved.
 
Dictionary< string, SaveRecordDict [get]
 Provides direct access to the dictionary of save records.
 

Detailed Description

Holds the data for a saved game.

Member Function Documentation

◆ DeleteData()

void PixelCrushers.SavedGameData.DeleteData ( string  key)
inline

Removes a Saver's data.

Parameters
keySaver's unique key.

◆ DeleteObsoleteSaveData()

void PixelCrushers.SavedGameData.DeleteObsoleteSaveData ( int  currentSceneIndex)
inline

Removes all save records except those in the current scene and those that are configured to remember across scene changes.

Parameters
currentSceneIndexDon't clear out Savers in this scene.

◆ GetData()

string PixelCrushers.SavedGameData.GetData ( string  key)
inline

Retrieves the previously-saved data for a Saver.

Parameters
keySaver's unique key.
Returns
Returns the data stored under the Saver's key, or null if no data is stored.

◆ GetDataInfo()

SaveRecord PixelCrushers.SavedGameData.GetDataInfo ( string  key)
inline

Retrieves info about the previously-saved data for a Saver.

Parameters
keySaver's unique key.
Returns
Returns the Save Record stored under the Saver's key, or null if no data is stored.

◆ OnAfterDeserialize()

void PixelCrushers.SavedGameData.OnAfterDeserialize ( )
inline

◆ OnBeforeSerialize()

void PixelCrushers.SavedGameData.OnBeforeSerialize ( )
inline

◆ SetData()

void PixelCrushers.SavedGameData.SetData ( string  key,
int  sceneIndex,
string  data 
)
inline

Stores a Saver's data.

Parameters
keySaver's unique key.
sceneIndexScene in which Saver exists.
dataData to set.

Property Documentation

◆ Dict

Dictionary<string, SaveRecord> PixelCrushers.SavedGameData.Dict
get

Provides direct access to the dictionary of save records.

Use with caution.

◆ sceneName

string PixelCrushers.SavedGameData.sceneName
getset

The scene in which the game was saved.

◆ version

int PixelCrushers.SavedGameData.version
getset

The save file format version.

This is an arbitrary value that you can assign by setting SaveSystem.version.


The documentation for this class was generated from the following file: