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
ファイルを表示 Open project: snozbot/fungus

Protected Properties

Property Type Description
loadAction System.Action
saveHistory SaveHistory

Public Methods

Method 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.

Protected Methods

Method 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 method

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
return void

ClearHistory() public method

Deletes all Save Points in the Save History.
public ClearHistory ( ) : void
return void

Delete() public method

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

ExecuteBlocks() protected method

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
return void

ExecuteStartBlock() protected method

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

FastForward() public method

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

GetDebugInfo() public method

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

Load() public method

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

LoadSavedGame() protected method

protected LoadSavedGame ( string saveDataKey ) : void
saveDataKey string
return void

OnDisable() protected method

protected OnDisable ( ) : void
return void

OnEnable() protected method

protected OnEnable ( ) : void
return void

OnSavePointLoaded() protected method

protected OnSavePointLoaded ( string savePointKey ) : void
savePointKey string
return void

OnSceneLoaded() protected method

protected OnSceneLoaded ( Scene scene, LoadSceneMode mode ) : void
scene UnityEngine.SceneManagement.Scene
mode LoadSceneMode
return void

ReadSaveHistory() protected method

protected ReadSaveHistory ( string saveDataKey ) : bool
saveDataKey string
return bool

Rewind() public method

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

Save() public method

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

SaveDataExists() public method

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

Update() protected method

protected Update ( ) : void
return void

WriteSaveHistory() protected method

protected WriteSaveHistory ( string saveDataKey ) : bool
saveDataKey string
return bool

Property Details

loadAction protected_oe property

protected System.Action loadAction
return System.Action

saveHistory protected_oe static_oe property

protected static SaveHistory,Fungus saveHistory
return SaveHistory