Adventure Creator
1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
string | GetDefaultSaveLabel (int saveID) |
Returns the default label of a save file. This is not the same as the filename - it is what's displayed in SavesList menus More... | |
void | DeleteAll (int profileID) |
Deletes all save files associated with a given profile More... | |
void | Delete (SaveFile saveFile, System.Action< bool > callback=null) |
Deletes a single save file More... | |
bool | SupportsSaveThreading () |
void | Save (SaveFile saveFile, string dataToSave, System.Action< bool > callback) |
Requests that game data be saved to disk. When saving is complete, it needs to confirm the output to SaveSystem.OnCompleteSave for the save to be recorded. More... | |
void | Load (SaveFile saveFile, bool doLog, System.Action< SaveFile, string > callback) |
Requests that save game data be loaded from disk. The resulting data needs to be sent back to SaveSystem.ReceiveLoadedData for it to actually be processed. More... | |
List< SaveFile > | GatherSaveFiles (int profileID) |
Reads the disk for all save files associated with a given profile More... | |
SaveFile | GetSaveFile (int saveID, int profileID) |
Reads the disk for a save file with a specific ID More... | |
List< SaveFile > | GatherImportFiles (int profileID, int boolID, string separateProductName, string separateFilePrefix) |
Reads the disk for all save files associated with a given profile from another game, to allow for the importing of data between games More... | |
void | SaveScreenshot (SaveFile saveFile) |
Saves a screenshot associated with a save file More... | |
An interface for classes that handle the creation, deletion, and loading of save-game files. This is can be overriden in the SaveSystem to allow for custom save file handling.
To override the handling of save files, create a new class that implements iSaveFileHandler, and assign it with:
Where MyClassName is the name of your class.
To have this code run when the game begins, place it in the Awake function of a script in your game's first scene.
void AC.iSaveFileHandler.Delete | ( | SaveFile | saveFile, |
System.Action< bool > | callback = null |
||
) |
Deletes a single save file
saveFile | The SaveFile container which stores information about the save to delete |
callback | An optional callback that contains a bool that's True if the delete was succesful |
Implemented in AC.SaveFileHandler_SystemFile, and AC.SaveFileHandler_PlayerPrefs.
void AC.iSaveFileHandler.DeleteAll | ( | int | profileID | ) |
Deletes all save files associated with a given profile
profileID | The ID number of the profile to delete saves for, or 0 if profiles are not enabled. |
Implemented in AC.SaveFileHandler_SystemFile, and AC.SaveFileHandler_PlayerPrefs.
List<SaveFile> AC.iSaveFileHandler.GatherImportFiles | ( | int | profileID, |
int | boolID, | ||
string | separateProductName, | ||
string | separateFilePrefix | ||
) |
Reads the disk for all save files associated with a given profile from another game, to allow for the importing of data between games
profileID | The ID number of the profile to search save files for, or 0 if profiles are not enabled |
boolID | The ID number of the Global Boolean variable that must be true in the file's data in order for it to be included, or -1 if this feature is not used |
separateProductName | The 'Product name' of the Unity product to import files from |
separateFilePrefix | The 'Save filename' field of the AC project to import files from, as set in the Settings Manager |
Implemented in AC.SaveFileHandler_SystemFile, and AC.SaveFileHandler_PlayerPrefs.
List<SaveFile> AC.iSaveFileHandler.GatherSaveFiles | ( | int | profileID | ) |
Reads the disk for all save files associated with a given profile
profileID | The ID number of the profile to search save files for, or 0 if profiles are not enabled |
Implemented in AC.SaveFileHandler_SystemFile, and AC.SaveFileHandler_PlayerPrefs.
string AC.iSaveFileHandler.GetDefaultSaveLabel | ( | int | saveID | ) |
Returns the default label of a save file. This is not the same as the filename - it is what's displayed in SavesList menus
saveID | The ID number of the save game |
Implemented in AC.SaveFileHandler_PlayerPrefs, and AC.SaveFileHandler_SystemFile.
SaveFile AC.iSaveFileHandler.GetSaveFile | ( | int | saveID, |
int | profileID | ||
) |
Reads the disk for a save file with a specific ID
saveID | The ID number of the save to search for |
profileID | The ID number of the save file's associated profile, or 0 if profiles are not enabled |
Implemented in AC.SaveFileHandler_SystemFile, and AC.SaveFileHandler_PlayerPrefs.
void AC.iSaveFileHandler.Load | ( | SaveFile | saveFile, |
bool | doLog, | ||
System.Action< SaveFile, string > | callback | ||
) |
Requests that save game data be loaded from disk. The resulting data needs to be sent back to SaveSystem.ReceiveLoadedData for it to actually be processed.
saveFile | The SaveFile container which stores information about the save to load |
doLog | If True, a log should be shown in the Console once the data has been read |
callback | A callback containing the SaveFile, and the save-data string |
Implemented in AC.SaveFileHandler_PlayerPrefs, and AC.SaveFileHandler_SystemFile.
void AC.iSaveFileHandler.Save | ( | SaveFile | saveFile, |
string | dataToSave, | ||
System.Action< bool > | callback | ||
) |
Requests that game data be saved to disk. When saving is complete, it needs to confirm the output to SaveSystem.OnCompleteSave for the save to be recorded.
saveFile | The SaveFile container which stores information about the file. Note that only the saveID, profileID and label have been correctly assigned by this point |
dataToSave | The data to save, as a serialized string |
callback | A callback containing a bool that's True if the save was successful |
Implemented in AC.SaveFileHandler_SystemFile, and AC.SaveFileHandler_PlayerPrefs.
void AC.iSaveFileHandler.SaveScreenshot | ( | SaveFile | saveFile | ) |
Saves a screenshot associated with a save file
saveFile | A data container for both the texture, and the associate save/profile IDs |
Implemented in AC.SaveFileHandler_SystemFile, and AC.SaveFileHandler_PlayerPrefs.
bool AC.iSaveFileHandler.SupportsSaveThreading | ( | ) |
Returns true if threading is supported when saving to disk
Implemented in AC.SaveFileHandler_SystemFile, and AC.SaveFileHandler_PlayerPrefs.