Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.SaveSystem Class Reference
Inheritance diagram for AC.SaveSystem:

Public Member Functions

void GatherSaveFiles (System.Action< List< SaveFile > > callback=null)
 Searches the filesystem for all available save files, and stores them in foundSaveFiles.
void GatherImportFiles (string projectName, string filePrefix, int boolID, System.Action< List< SaveFile > > callback)
 Searches the filesystem for all available import files, and stores them in foundImportFiles.
void SetSelectiveLoadOptions (SelectiveLoad selectiveLoad)
 Sets the local instance of SelectiveLoad, which determines which save data is restored the next time (and only the next time) LoadGame is called.
void ClearAllData ()
void ReceiveDataToImport (SaveFile saveFile, string fileData)
 Processes the save data requested by ImportSaveGame.
void ReceiveDataToLoad (SaveFile saveFile, string fileData)
 Processes the save data requested by LoadSaveGame.
PlayerData GetPlayerData (int playerID)
 Gets all recorded data related to a given Player. This should typically be an inactive Player - otherwise the active Player should just be read directly.
void InitAfterLoad (int saveID=-1)
void SwitchToPlayerInDifferentScene (int playerID, int sceneIndex, bool doOverlay)
 Switches to a new Player in a different scene.
void SwitchToPlayerInDifferentScene (int playerID, string sceneName, bool doOverlay)
 Switches to a new Player in a different scene.
int GetNewSaveID ()
void OnCompleteSaveOperation (SaveFile saveFile, bool wasSuccesful, SaveOperation saveOperation, System.Action onComplete)
void SaveCurrentPlayerData ()
void SaveNonPlayerData (bool stopFollowCommands)
bool DoImportCheck (string fileData, int boolID)
 Checks that another game's save file data is OK to import, by checking the state of a given boolean variable.
string GetSlotLabel (int elementSlot, int saveID, bool useSaveID, SaveFile[] saveFiles)
 Gets the label of a save file.
Texture2D GetScreenshot (int elementSlot, int saveID, bool useSaveID, SaveFile[] saveFiles)
 Gets the screenshot of a save file.
int GetPlayerSceneIndex (int ID)
 Gets the current scene index that a Player is in.
string GetPlayerSceneName (int ID)
 Gets the current scene name that a Player is in.
void MoveInactivePlayerToCurrentScene (int ID, TeleportPlayerStartMethod teleportPlayerStartMethod, PlayerStart newPlayerStart=null, System.Action onComplete=null)
 Updates the internal record of an inactive Player's position to the current scene, provided that player-switching is allowed. If that Player has an Associated NPC, then it will be spawned or teleported to the Player's new position.
void MoveInactivePlayer (int ID, int newSceneIndex, TeleportPlayerStartMethod teleportPlayerStartMethod, int newPlayerStartConstantID=0, System.Action onComplete=null)
 Moves an inactive Player to a new scene.
void MoveInactivePlayer (int ID, string newSceneNamex, TeleportPlayerStartMethod teleportPlayerStartMethod, int newPlayerStartConstantID=0, System.Action onComplete=null)
 Moves an inactive Player to a new scene.
IEnumerator AssignPlayerData (Player player)
 Updates a Player object with its associated saved data, if it exists.
InvCollection GetItemsFromPlayer (int _playerID)
 Returns a collection of inventory items currently carried by a particular Player.
void AssignItemsToPlayer (InvCollection invCollection, int _playerID)
 Re-assigns the inventory items currently carried by a particular Player.
void SetInitialPlayerID ()
IEnumerator SpawnAllPlayers ()
IEnumerator SpawnFollowingPlayers ()
void AssignObjectivesToPlayer (string dataString, int _playerID)
void RenameSave (string newLabel, int saveIndex)
 Renames the label of a save game file.
void RenameSaveByID (string newLabel, int saveID)
 Renames the label of a save game file.
void DeleteProfile (int profileIndex=-2, bool includeActive=true)
 Deletes a player profile by referencing its entry in a MenuProfilesList element.
void DeleteProfileID (int profileID)
 Deletes a player profile ID.
void DeleteSave (int elementSlot, int saveID, bool useSaveID)
 Deletes a save game file.
int GetNumSaves (bool includeAutoSaves=true)
 Gets the number of save game files found.
SaveFile GetSaveFile (int saveID)
 Gets an existing SaveFile found on the system.
SaveFile GetImportFile (int saveID)

Static Public Member Functions

static void UpdateSaveFileLabels (ref List< SaveFile > _saveFiles)
static string GetSaveExtension ()
 Gets the extension of the current save method.
static bool DoesImportExist (int saveID)
 Checks if an import file with a particular ID number exists.
static bool DoesSaveExist (int elementSlot, int saveID, bool useSaveID)
 Checks if a save file with a particular ID number exists.
static bool DoesSaveExist (int saveID)
 Checks if a save file with a particular ID number exists.
static void LoadAutoSave ()
static void ImportGame (int elementSlot, int saveID, bool useSaveID)
 Imports a save file from another Adventure Creator game.
static void ContinueGame (System.Action onFail=null)
static bool LoadGame (int saveID)
 Loads a save game file.
static void LoadGame (SaveFile saveFile)
 Loads a save game file.
static bool LoadGame (int elementSlot, int saveID, bool useSaveID)
 Loads a save game file.
static SaveData ExtractMainData (string saveFileContents)
 Extracts global data from a save game file's raw (serialized) contents.
static List< SingleLevelDataExtractSceneData (string saveFileContents)
 Extracts all scene data from a save game file's raw (serialized) contents.
static void ExtractSaveFileVariables (SaveFile saveFile, System.Action< List< GVar > > callback)
 Extracts the Global Variables data of from a save file.
static void SaveNewGame (bool overwriteLabel=true, string newLabel="", System.Action onComplete=null)
 Create a new save game file.
static void SaveAutoSave ()
static void SaveGame (int saveID, bool overwriteLabel=true, string newLabel="", System.Action onComplete=null)
 Saves the game.
static void SaveGame (int elementSlot, int saveID, bool useSaveID, bool overwriteLabel=true, string newLabel="", System.Action onComplete=null)
 Saves the game.
static int GetNumImportSlots ()
 Gets the number of found import files.
static int GetNumSlots ()
 Gets the number of found save files.
static string GenerateSaveSuffix (int saveID, int profileID=-1)
 Creates a suffix for save filenames based on a given save slot and profile.
static string GetImportSlotLabel (int elementSlot, int saveID, bool useSaveID)
 Gets the label of an import file.
static string GetSaveSlotLabel (int elementSlot, int saveID, bool useSaveID)
 Gets the label of a save file.
static Texture2D GetImportSlotScreenshot (int elementSlot, int saveID, bool useSaveID)
 Gets the screenshot of an import file.
static Texture2D GetSaveSlotScreenshot (int elementSlot, int saveID, bool useSaveID)
 Gets the screenshot of a save file.
static void AssignVariables (string runtimeVariablesData, bool fromOptions=false)
 Unloads stored global variable data back into the RuntimeVariables script.
static string CreateVariablesData (List< GVar > vars, bool isOptionsData, VariableLocation location)
 Condenses the values of a List of variables into a single string.
static List< GVarUnloadVariablesData (string data, bool updateExistingVars, List< GVar > existingVars, bool fromOptions=false)
 Updates a list of Variables with value data stored as a string.
static void DeleteSave (int saveID)
 Deletes a save game file.
static string CompressString (string text)
static string DecompressString (string compressedText)

Public Attributes

List< SaveFilefoundSaveFiles = new List<SaveFile> ()
List< SaveFilefoundImportFiles = new List<SaveFile> ()

Static Public Attributes

const string pipe = "|"
const string colon = ":"
const string mainDataDivider = "||"
const string mainDataDivider_Replacement = "*DOUBLEPIPE*"

Protected Member Functions

void OnEnable ()
void OnDisable ()
void UpdateSaveList (SaveFile saveFile)
virtual Texture2D GetScreenshotTexture ()
void OnAddSubScene (SubScene subScene)

Static Protected Member Functions

static int GetDivider (string saveFileContents)

Protected Attributes

LoadingGame _loadingGame

Properties

bool IsInitialisingAfterLoad [get]
virtual int ScreenshotWidth [get]
virtual int ScreenshotHeight [get]
int CurrentPlayerID [get, set]
bool IsTakingSaveScreenshot [get]
static iSaveFileHandler SaveFileHandler [get, set]
static iFileFormatHandler FileFormatHandler [get, set]
static iFileFormatHandler OptionsFileFormatHandler [get, set]
LoadingGame loadingGame [get]
static string PersistentDataPath [get, set]
static string SaveLabel [get]
static string ImportLabel [get]
static string AutosaveLabel [get]

Detailed Description

Processes save game data to and from scene objects.

Member Function Documentation

◆ AssignItemsToPlayer()

void AC.SaveSystem.AssignItemsToPlayer ( InvCollection invCollection,
int _playerID )

Re-assigns the inventory items currently carried by a particular Player.

Parameters
invCollectionThe collection of items representing the inventory items
_playerIDThe ID number of the Player to assign the inventory of

◆ AssignPlayerData()

IEnumerator AC.SaveSystem.AssignPlayerData ( Player player)

Updates a Player object with its associated saved data, if it exists.

Parameters
playerThe Player to load animation data for

◆ AssignVariables()

void AC.SaveSystem.AssignVariables ( string runtimeVariablesData,
bool fromOptions = false )
static

Unloads stored global variable data back into the RuntimeVariables script.

Parameters
runtimeVariablesDataThe values of all global variables, combined into a stingle string
fromOptionsIf true, only global variables that are linked to OptionsData will be affected

◆ ClearAllData()

void AC.SaveSystem.ClearAllData ( )

Clears all save data stored in the SaveData class.

◆ ContinueGame()

void AC.SaveSystem.ContinueGame ( System.Action onFail = null)
static

Loads the last-recorded save game file.

◆ CreateVariablesData()

string AC.SaveSystem.CreateVariablesData ( List< GVar > vars,
bool isOptionsData,
VariableLocation location )
static

Condenses the values of a List of variables into a single string.

Parameters
varsA List of variables (see GVar) to condense
isOptionsDataIf True, only global variables that are linked to OptionsData will be included
locationThe variables' location (Local, Variable)
Returns
The variable's values, condensed into a single string

◆ DeleteProfile()

void AC.SaveSystem.DeleteProfile ( int profileIndex = -2,
bool includeActive = true )

Deletes a player profile by referencing its entry in a MenuProfilesList element.

Parameters
profileIndexThe index in the MenuProfilesList element that represents the profile to delete. If it is set to its default, -2, the active profile will be deleted
includeActiveIf True, then the MenuProfilesList element that the profile was selected from also displays the active profile

◆ DeleteProfileID()

void AC.SaveSystem.DeleteProfileID ( int profileID)

Deletes a player profile ID.

Parameters
profileIDThe profile ID to delete

◆ DeleteSave() [1/2]

void AC.SaveSystem.DeleteSave ( int elementSlot,
int saveID,
bool useSaveID )

Deletes a save game file.

Parameters
elementSlotThe slot index of the MenuProfilesList element that was clicked on
saveIDThe save ID to delete
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to delete

◆ DeleteSave() [2/2]

void AC.SaveSystem.DeleteSave ( int saveID)
static

Deletes a save game file.

Parameters
saveIDThe save ID of the file to load

◆ DoesImportExist()

bool AC.SaveSystem.DoesImportExist ( int saveID)
static

Checks if an import file with a particular ID number exists.

Parameters
saveIDThe import ID to check for
Returns
True if an import file with a matching ID number exists

◆ DoesSaveExist() [1/2]

bool AC.SaveSystem.DoesSaveExist ( int elementSlot,
int saveID,
bool useSaveID )
static

Checks if a save file with a particular ID number exists.

Parameters
elementSlotThe slot index of the MenuSavesList element
saveIDThe save ID to check for
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to check for
Returns
True if a save file with a matching ID number exists

◆ DoesSaveExist() [2/2]

bool AC.SaveSystem.DoesSaveExist ( int saveID)
static

Checks if a save file with a particular ID number exists.

Parameters
saveIDThe save ID to check for
Returns
True if a save file with a matching ID number exists

◆ DoImportCheck()

bool AC.SaveSystem.DoImportCheck ( string fileData,
int boolID )

Checks that another game's save file data is OK to import, by checking the state of a given boolean variable.

Parameters
fileDataThe de-serialized data string from the file
boolIDThe ID number of the Boolean Global Variable that must be True in the fileData for the import check to pass
Returns
True if the other game's save file data is OK to import

◆ ExtractMainData()

SaveData AC.SaveSystem.ExtractMainData ( string saveFileContents)
static

Extracts global data from a save game file's raw (serialized) contents.

Parameters
saveFileContentsThe raw contents of the save file
Returns
The global data stored within the save file

◆ ExtractSaveFileVariables()

void AC.SaveSystem.ExtractSaveFileVariables ( SaveFile saveFile,
System.Action< List< GVar > > callback )
static

Extracts the Global Variables data of from a save file.

Parameters
saveFileThe save file to extract Global Global Variables from
callbackA callback with the resulting List of GVar variables

◆ ExtractSceneData()

List< SingleLevelData > AC.SaveSystem.ExtractSceneData ( string saveFileContents)
static

Extracts all scene data from a save game file's raw (serialized) contents.

Parameters
saveFileContentsThe raw contents of the save file
Returns
All scene data stored within the save file

◆ GatherImportFiles()

void AC.SaveSystem.GatherImportFiles ( string projectName,
string filePrefix,
int boolID,
System.Action< List< SaveFile > > callback )

Searches the filesystem for all available import files, and stores them in foundImportFiles.

Parameters
projectNameThe project name of the game whose save files we're looking to import
filePrefixThe "save filename" of the game whose save files we're looking to import, as set in the Settings Manager
boolIDIf >= 0, the ID of the boolean Global Variable that must be True for the file to be considered valid for import
callbackA callback to invoke, with the files, once complete

◆ GatherSaveFiles()

void AC.SaveSystem.GatherSaveFiles ( System.Action< List< SaveFile > > callback = null)

Searches the filesystem for all available save files, and stores them in foundSaveFiles.

Parameters
callbackA callback to invoke upon completion

◆ GenerateSaveSuffix()

string AC.SaveSystem.GenerateSaveSuffix ( int saveID,
int profileID = -1 )
static

Creates a suffix for save filenames based on a given save slot and profile.

Parameters
saveIDThe ID of the save slot
profileIDThe ID of the profile

<return>A save file suffix based on the slot and profile

◆ GetImportSlotLabel()

string AC.SaveSystem.GetImportSlotLabel ( int elementSlot,
int saveID,
bool useSaveID )
static

Gets the label of an import file.

Parameters
elementSlotThe slot index of the MenuProfilesList element that was clicked on
saveIDThe save ID to import
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to import
Returns
The label of the import file.

◆ GetImportSlotScreenshot()

Texture2D AC.SaveSystem.GetImportSlotScreenshot ( int elementSlot,
int saveID,
bool useSaveID )
static

Gets the screenshot of an import file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to get the screenshot of
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to look for
Returns
The import files's screenshots as a Texture2D. If the save file is not found, null is returned.

◆ GetItemsFromPlayer()

InvCollection AC.SaveSystem.GetItemsFromPlayer ( int _playerID)

Returns a collection of inventory items currently carried by a particular Player.

Parameters
_playerIDThe ID number of the Player to check the inventory of
Returns
A collection representing the inventory items

◆ GetNewSaveID()

int AC.SaveSystem.GetNewSaveID ( )

Gets the first-found ID for a new save

◆ GetNumImportSlots()

int AC.SaveSystem.GetNumImportSlots ( )
static

Gets the number of found import files.

Returns
The number of found import files

◆ GetNumSaves()

int AC.SaveSystem.GetNumSaves ( bool includeAutoSaves = true)

Gets the number of save game files found.

Parameters
includeAutoSavesIf True, then autosave files will be included in the result
Returns
The number of save games found

◆ GetNumSlots()

int AC.SaveSystem.GetNumSlots ( )
static

Gets the number of found save files.

Returns
The number of found save files

◆ GetPlayerData()

PlayerData AC.SaveSystem.GetPlayerData ( int playerID)

Gets all recorded data related to a given Player. This should typically be an inactive Player - otherwise the active Player should just be read directly.

Parameters
playerIDThe ID of the Player to get data for
Returns
All recorded data related to the Player

◆ GetPlayerSceneIndex()

int AC.SaveSystem.GetPlayerSceneIndex ( int ID)

Gets the current scene index that a Player is in.

Parameters
IDThe ID number of the Player to check
Returns
The current scene index that the Player is in.

◆ GetPlayerSceneName()

string AC.SaveSystem.GetPlayerSceneName ( int ID)

Gets the current scene name that a Player is in.

Parameters
IDThe ID number of the Player to check
Returns
The current scene name that the Player is in.

◆ GetSaveExtension()

string AC.SaveSystem.GetSaveExtension ( )
static

Gets the extension of the current save method.

Returns
The extension of the current save method

◆ GetSaveFile()

SaveFile AC.SaveSystem.GetSaveFile ( int saveID)

Gets an existing SaveFile found on the system.

Parameters
saveIDThe ID number of the save to retrieve
Returns
The SaveFile class instance

◆ GetSaveSlotLabel()

string AC.SaveSystem.GetSaveSlotLabel ( int elementSlot,
int saveID,
bool useSaveID )
static

Gets the label of a save file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to save
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to save
Returns
The label of the save file. If the save file is not found, an empty string is returned.

◆ GetSaveSlotScreenshot()

Texture2D AC.SaveSystem.GetSaveSlotScreenshot ( int elementSlot,
int saveID,
bool useSaveID )
static

Gets the screenshot of a save file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to get the screenshot of
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to look for

<return>The save files's screenshots as a Texture2D. If the save file is not found, null is returned.

◆ GetScreenshot()

Texture2D AC.SaveSystem.GetScreenshot ( int elementSlot,
int saveID,
bool useSaveID,
SaveFile[] saveFiles )

Gets the screenshot of a save file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to get the screenshot of
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to look for
saveFilesAn array of SaveFile instances that the save file to retrieve is assumed to be in
Returns
The save files's screenshots as a Texture2D. If the save file is not found, null is returned.

◆ GetSlotLabel()

string AC.SaveSystem.GetSlotLabel ( int elementSlot,
int saveID,
bool useSaveID,
SaveFile[] saveFiles )

Gets the label of a save file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to save
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to save
saveFilesAn array of SaveFile instances that the save file to retrieve is assumed to be in
Returns
The label of the save file. If the save file is not found, an empty string is returned.

◆ ImportGame()

void AC.SaveSystem.ImportGame ( int elementSlot,
int saveID,
bool useSaveID )
static

Imports a save file from another Adventure Creator game.

Parameters
elementSlotThe slot index of the MenuProfilesList element that was clicked on
saveIDThe save ID to import
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to import

◆ LoadAutoSave()

void AC.SaveSystem.LoadAutoSave ( )
static

Loads the AutoSave save file. If multiple save profiles are used, the current profiles AutoSave will be loaded.

◆ LoadGame() [1/3]

bool AC.SaveSystem.LoadGame ( int elementSlot,
int saveID,
bool useSaveID )
static

Loads a save game file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to load
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to load
Returns
True if a file was found

◆ LoadGame() [2/3]

bool AC.SaveSystem.LoadGame ( int saveID)
static

Loads a save game file.

Parameters
saveIDThe save ID of the file to load
Returns
True if a file was found

◆ LoadGame() [3/3]

void AC.SaveSystem.LoadGame ( SaveFile saveFile)
static

Loads a save game file.

Parameters
saveFileThe save file to load
Returns
True if a file was found

◆ MoveInactivePlayer() [1/2]

void AC.SaveSystem.MoveInactivePlayer ( int ID,
int newSceneIndex,
TeleportPlayerStartMethod teleportPlayerStartMethod,
int newPlayerStartConstantID = 0,
System.Action onComplete = null )

Moves an inactive Player to a new scene.

Parameters
IDThe inactive Player's ID number
newSceneIndexThe new scene to switch to
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
newPlayerStartConstantIDIf teleportPlayerStartMethod = EnteredHere, the Constant ID number of the associated PlayerStart to appear at in the new scene

◆ MoveInactivePlayer() [2/2]

void AC.SaveSystem.MoveInactivePlayer ( int ID,
string newSceneNamex,
TeleportPlayerStartMethod teleportPlayerStartMethod,
int newPlayerStartConstantID = 0,
System.Action onComplete = null )

Moves an inactive Player to a new scene.

Parameters
IDThe inactive Player's ID number
newSceneNamexThe new scene to switch to
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
newPlayerStartConstantIDIf teleportPlayerStartMethod = EnteredHere, the Constant ID number of the associated PlayerStart to appear at in the new scene

◆ MoveInactivePlayerToCurrentScene()

void AC.SaveSystem.MoveInactivePlayerToCurrentScene ( int ID,
TeleportPlayerStartMethod teleportPlayerStartMethod,
PlayerStart newPlayerStart = null,
System.Action onComplete = null )

Updates the internal record of an inactive Player's position to the current scene, provided that player-switching is allowed. If that Player has an Associated NPC, then it will be spawned or teleported to the Player's new position.

Parameters
IDThe ID number of the Player to affect, as set in the Settings Manager's list of Player prefabs
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
newPlayerStartIf teleportPlayerStartMethod = EnteredHere, a PlayerStart to use as the basis for the Player's new position and rotation

◆ ReceiveDataToImport()

void AC.SaveSystem.ReceiveDataToImport ( SaveFile saveFile,
string fileData )

Processes the save data requested by ImportSaveGame.

Parameters
saveFileA data container for information about the save file to import. Its saveID and profileID need to match up with that requested in the iSaveFileHandler's Import function in order for the data to be processed
saveFileContentsThe file contents of the save file. This is empty if the import failed.

◆ ReceiveDataToLoad()

void AC.SaveSystem.ReceiveDataToLoad ( SaveFile saveFile,
string fileData )

Processes the save data requested by LoadSaveGame.

Parameters
saveFileA data container for information about the save file to load. Its saveID and profileID need to match up with that requested in the iSaveFileHandler's Load function in order for the data to be processed
saveFileContentsThe file contents of the save file. This is empty if the load failed.

◆ RenameSave()

void AC.SaveSystem.RenameSave ( string newLabel,
int saveIndex )

Renames the label of a save game file.

Parameters
newLabelThe new label to give the save game file
saveIndexThe index of the foundSaveFiles List that represents the save file to affect

◆ RenameSaveByID()

void AC.SaveSystem.RenameSaveByID ( string newLabel,
int saveID )

Renames the label of a save game file.

Parameters
newLabelThe new label to give the save game file
saveIDThe ID that represents the save file to affect

◆ SaveAutoSave()

void AC.SaveSystem.SaveAutoSave ( )
static

Overwrites the AutoSave file.

◆ SaveCurrentPlayerData()

void AC.SaveSystem.SaveCurrentPlayerData ( )

Stores the PlayerData of the active Player.

◆ SaveGame() [1/2]

void AC.SaveSystem.SaveGame ( int elementSlot,
int saveID,
bool useSaveID,
bool overwriteLabel = true,
string newLabel = "",
System.Action onComplete = null )
static

Saves the game.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to save
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to save
overwriteLabelTrue if the label should be updated
newLabelThe new label, if it can be set. If blank, a default label will be generated.

◆ SaveGame() [2/2]

void AC.SaveSystem.SaveGame ( int saveID,
bool overwriteLabel = true,
string newLabel = "",
System.Action onComplete = null )
static

Saves the game.

Parameters
saveIDThe save ID to save
overwriteLabelTrue if the label should be updated
newLabelThe new label, if it can be set. If blank, a default label will be generated.
onCompleteA callback to invoke upon completion

◆ SaveNewGame()

void AC.SaveSystem.SaveNewGame ( bool overwriteLabel = true,
string newLabel = "",
System.Action onComplete = null )
static

Create a new save game file.

Parameters
overwriteLabelTrue if the label should be updated
newLabelThe new label, if it can be set
onCompleteA callback to invoke upon completion

◆ SetSelectiveLoadOptions()

void AC.SaveSystem.SetSelectiveLoadOptions ( SelectiveLoad selectiveLoad)

Sets the local instance of SelectiveLoad, which determines which save data is restored the next time (and only the next time) LoadGame is called.

Parameters
selectiveLoadAn instance of SelectiveLoad the defines what elements to load

◆ SwitchToPlayerInDifferentScene() [1/2]

void AC.SaveSystem.SwitchToPlayerInDifferentScene ( int playerID,
int sceneIndex,
bool doOverlay )

Switches to a new Player in a different scene.

Parameters
playerIDThe ID of the Player to switch to
sceneIndexThe new scene to switch to
doOverlayIf True, then a screenshot of the existing scene will be overlaid on top of the camera to mask the transition

◆ SwitchToPlayerInDifferentScene() [2/2]

void AC.SaveSystem.SwitchToPlayerInDifferentScene ( int playerID,
string sceneName,
bool doOverlay )

Switches to a new Player in a different scene.

Parameters
playerIDThe ID of the Player to switch to
sceneNameThe new scene to switch to
doOverlayIf True, then a screenshot of the existing scene will be overlaid on top of the camera to mask the transition

◆ UnloadVariablesData()

List< GVar > AC.SaveSystem.UnloadVariablesData ( string data,
bool updateExistingVars,
List< GVar > existingVars,
bool fromOptions = false )
static

Updates a list of Variables with value data stored as a string.

Parameters
dataThe save-data string, serialized in the save file
updateExistingVarsIf True, the variabels stored in the existingVars parameter List will be updated, as opposed to merely used for reference
existingVarsA list of existing Variables whose values will be updated.
Parameters
fromOptionsIf True, the only Variables that are linked to Options Data will be updated
Returns
The updated list of Variables

Member Data Documentation

◆ foundImportFiles

List<SaveFile> AC.SaveSystem.foundImportFiles = new List<SaveFile> ()

A List of SaveFile variables, storing all available import files.

◆ foundSaveFiles

List<SaveFile> AC.SaveSystem.foundSaveFiles = new List<SaveFile> ()

An List of SaveFile variables, storing all available save files.

Property Documentation

◆ FileFormatHandler

iFileFormatHandler AC.SaveSystem.FileFormatHandler
staticgetset

The iFileFormatHandler class that handles the serialization and deserialzation of data

◆ IsTakingSaveScreenshot

bool AC.SaveSystem.IsTakingSaveScreenshot
get

If True, then a save-game screenshot is being taken

◆ loadingGame

LoadingGame AC.SaveSystem.loadingGame
get

What type of load is being performed (No, InNewScene, InSameScene, JustSwitchingPlayer)

◆ OptionsFileFormatHandler

iFileFormatHandler AC.SaveSystem.OptionsFileFormatHandler
staticgetset

The iFileFormatHandler class that handles the serialization and deserialzation of Options data. If this is not explicitly set, it will return the same value as FileFormatHandler

◆ PersistentDataPath

string AC.SaveSystem.PersistentDataPath
staticgetset

The root path to store save-game files. If set to a non-empty value, this will override the default (Application.persistentDataPath)

◆ SaveFileHandler

iSaveFileHandler AC.SaveSystem.SaveFileHandler
staticgetset

The iSaveFileHandler class that handles the creation, loading, and deletion of save files

◆ ScreenshotHeight

virtual int AC.SaveSystem.ScreenshotHeight
get

The height of save-game screenshot textures

◆ ScreenshotWidth

virtual int AC.SaveSystem.ScreenshotWidth
get

The width of save-game screenshot textures