Class XmlSavegameManager
The XmlSavegameManager is a component that should only ever exist once per scene.
It provides functionality for saving/loading the game's state.
The savegame's file format is xml that can be optionally compressed and/or encrypted.
Inherited Members
Namespace: GlitchedPolygons.SavegameFramework.Xml
Assembly: UnityScriptsLibrary.dll
Syntax
public sealed class XmlSavegameManager : SavegameManager
Methods
| Improve this Doc View SourceGatherSaveableComponentsInScene()
Gathers all the XmlSaveableComponents in the scene and registers them to the GlitchedPolygons.SavegameFramework.Xml.XmlSavegameManager.saveableComponents array.
Declaration
public void GatherSaveableComponentsInScene()
Load(String)
Loads a savegame file from inside the savegamesDirectoryPath.
The
fileName parameter is just the savegame's file name (local to the savegamesDirectoryPath and WITHOUT THE FILE EXTENSION).This will cause a chain reaction of method calls and procedures in order to make the loading procedure and map transition as smooth as possible.
The method registers GlitchedPolygons.SavegameFramework.Xml.XmlSavegameManager.OnNewSceneLoaded(Scene,LoadSceneMode) to the
What happens next is that the GlitchedPolygons.SavegameFramework.Xml.XmlSavegameManager.OnNewSceneLoaded(Scene,LoadSceneMode) method is fired in the NEW scene on the OLD XmlSavegameManager instance.
That method then passes its GlitchedPolygons.SavegameFramework.Xml.XmlSavegameManager.transitorySavegame document over to the new scene's XmlSavegameManager, and calls GlitchedPolygons.SavegameFramework.Xml.XmlSavegameManager.Reconstruct on it. The old scene's XmlSavegameManager can now die safely.
Declaration
public override void Load(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fileName | The savegame's file name (WITHOUT ITS EXTENSION!). Path is local to the savegamesDirectoryPath. |
Overrides
| Improve this Doc View SourceSave(String)
Saves the game out to a time-stamped savegame file inside the savegamesDirectoryPath folder.
Declaration
public override void Save(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fileName | The savegame's file name (WITHOUT EXTENSION!) |