C# Class Fungus.SaveManager

Manages the Save History (a list of Save Points) and provides a set of operations for saving and loading games.
Inheritance: UnityEngine.MonoBehaviour
Afficher le fichier Open project: snozbot/fungus

Protected Properties

Свойство Type Description
loadAction System.Action
saveHistory SaveHistory

Méthodes publiques

Méthode Description
AddSavePoint ( string savePointKey, string savePointDescription ) : void

Creates a new Save Point using a key and description, and adds it to the Save History.

ClearHistory ( ) : void

Deletes all Save Points in the Save History.

Delete ( string saveDataKey = DefaultSaveDataKey ) : void

Deletes a previously stored Save History from persistent storage.

FastForward ( ) : void

Fast forwards to the next rewound Save Point in the Save History and loads that Save Point.

GetDebugInfo ( ) : string

Returns an info string to help debug issues with the save data.

Load ( string saveDataKey = DefaultSaveDataKey ) : void

Loads the Save History from persistent storage and loads the latest Save Point.

Rewind ( ) : void

Rewinds to the previous Save Point in the Save History and loads that Save Point.

Save ( string saveDataKey = DefaultSaveDataKey ) : void

Writes the Save History to persistent storage.

SaveDataExists ( string saveDataKey = DefaultSaveDataKey ) : bool

Returns true if save data has previously been stored using this key.

Méthodes protégées

Méthode Description
ExecuteBlocks ( string savePointKey ) : void

Starts Block execution based on a Save Point Key The execution order is: 1. Save Point Loaded event handlers with a matching key. 2. First Save Point command (in any Block) with matching key. Execution starts at the following command. 3. Any label in any block with name matching the key. Execution starts at the following command.

ExecuteStartBlock ( ) : void

Starts execution at the first Save Point found in the scene with the IsStartPoint property enabled.

LoadSavedGame ( string saveDataKey ) : void
OnDisable ( ) : void
OnEnable ( ) : void
OnSavePointLoaded ( string savePointKey ) : void
OnSceneLoaded ( Scene scene, LoadSceneMode mode ) : void
ReadSaveHistory ( string saveDataKey ) : bool
Update ( ) : void
WriteSaveHistory ( string saveDataKey ) : bool

Method Details

AddSavePoint() public méthode

Creates a new Save Point using a key and description, and adds it to the Save History.
public AddSavePoint ( string savePointKey, string savePointDescription ) : void
savePointKey string
savePointDescription string
Résultat void

ClearHistory() public méthode

Deletes all Save Points in the Save History.
public ClearHistory ( ) : void
Résultat void

Delete() public méthode

Deletes a previously stored Save History from persistent storage.
public Delete ( string saveDataKey = DefaultSaveDataKey ) : void
saveDataKey string
Résultat void

ExecuteBlocks() protected méthode

Starts Block execution based on a Save Point Key The execution order is: 1. Save Point Loaded event handlers with a matching key. 2. First Save Point command (in any Block) with matching key. Execution starts at the following command. 3. Any label in any block with name matching the key. Execution starts at the following command.
protected ExecuteBlocks ( string savePointKey ) : void
savePointKey string
Résultat void

ExecuteStartBlock() protected méthode

Starts execution at the first Save Point found in the scene with the IsStartPoint property enabled.
protected ExecuteStartBlock ( ) : void
Résultat void

FastForward() public méthode

Fast forwards to the next rewound Save Point in the Save History and loads that Save Point.
public FastForward ( ) : void
Résultat void

GetDebugInfo() public méthode

Returns an info string to help debug issues with the save data.
public GetDebugInfo ( ) : string
Résultat string

Load() public méthode

Loads the Save History from persistent storage and loads the latest Save Point.
public Load ( string saveDataKey = DefaultSaveDataKey ) : void
saveDataKey string
Résultat void

LoadSavedGame() protected méthode

protected LoadSavedGame ( string saveDataKey ) : void
saveDataKey string
Résultat void

OnDisable() protected méthode

protected OnDisable ( ) : void
Résultat void

OnEnable() protected méthode

protected OnEnable ( ) : void
Résultat void

OnSavePointLoaded() protected méthode

protected OnSavePointLoaded ( string savePointKey ) : void
savePointKey string
Résultat void

OnSceneLoaded() protected méthode

protected OnSceneLoaded ( Scene scene, LoadSceneMode mode ) : void
scene UnityEngine.SceneManagement.Scene
mode LoadSceneMode
Résultat void

ReadSaveHistory() protected méthode

protected ReadSaveHistory ( string saveDataKey ) : bool
saveDataKey string
Résultat bool

Rewind() public méthode

Rewinds to the previous Save Point in the Save History and loads that Save Point.
public Rewind ( ) : void
Résultat void

Save() public méthode

Writes the Save History to persistent storage.
public Save ( string saveDataKey = DefaultSaveDataKey ) : void
saveDataKey string
Résultat void

SaveDataExists() public méthode

Returns true if save data has previously been stored using this key.
public SaveDataExists ( string saveDataKey = DefaultSaveDataKey ) : bool
saveDataKey string
Résultat bool

Update() protected méthode

protected Update ( ) : void
Résultat void

WriteSaveHistory() protected méthode

protected WriteSaveHistory ( string saveDataKey ) : bool
saveDataKey string
Résultat bool

Property Details

loadAction protected_oe property

protected System.Action loadAction
Résultat System.Action

saveHistory protected_oe static_oe property

protected static SaveHistory,Fungus saveHistory
Résultat SaveHistory