Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.SaveFileHandler_PlayerPrefs Class Reference
Inheritance diagram for AC.SaveFileHandler_PlayerPrefs:
AC.iSaveFileHandler

Public Member Functions

virtual 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...
 
virtual void DeleteAll (int profileID)
 Deletes all save files associated with a given profile More...
 
virtual void Delete (SaveFile saveFile, System.Action< bool > callback=null)
 Deletes a single save file More...
 
virtual 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...
 
virtual 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...
 
virtual bool SupportsSaveThreading ()
 
virtual List< SaveFileGatherSaveFiles (int profileID)
 Reads the disk for all save files associated with a given profile More...
 
virtual SaveFile GetSaveFile (int saveID, int profileID)
 Reads the disk for a save file with a specific ID More...
 
virtual List< SaveFileGatherImportFiles (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...
 
virtual void SaveScreenshot (SaveFile saveFile)
 Saves a screenshot associated with a save file More...
 

Protected Member Functions

virtual List< SaveFileGatherSaveFiles (int profileID, bool isImport, int boolID, string separateFilePrefix)
 
virtual SaveFile GetSaveFile (int saveID, int profileID, bool isImport, int boolID, string separateFilePrefix)
 
virtual string GetSaveFilename (int saveID, int profileID=-1)
 
virtual string GetImportFilename (int saveID, string filePrefix, int profileID=-1)
 
virtual string GetTimeString (DateTime dateTime)
 

Static Protected Attributes

const string screenshotKey = "_screenshot"
 

Properties

virtual int MaxSaves [get]
 

Detailed Description

A save-file handler that stores save-games as separate keys in the PlayerPrefs

Member Function Documentation

◆ Delete()

virtual void AC.SaveFileHandler_PlayerPrefs.Delete ( SaveFile  saveFile,
System.Action< bool >  callback = null 
)
virtual

Deletes a single save file

Parameters
saveFileThe SaveFile container which stores information about the save to delete
callbackAn optional callback that contains a bool that's True if the delete was succesful

Implements AC.iSaveFileHandler.

◆ DeleteAll()

virtual void AC.SaveFileHandler_PlayerPrefs.DeleteAll ( int  profileID)
virtual

Deletes all save files associated with a given profile

Parameters
profileIDThe ID number of the profile to delete saves for, or 0 if profiles are not enabled.

Implements AC.iSaveFileHandler.

◆ GatherImportFiles()

virtual List<SaveFile> AC.SaveFileHandler_PlayerPrefs.GatherImportFiles ( int  profileID,
int  boolID,
string  separateProductName,
string  separateFilePrefix 
)
virtual

Reads the disk for all save files associated with a given profile from another game, to allow for the importing of data between games

Parameters
profileIDThe ID number of the profile to search save files for, or 0 if profiles are not enabled
boolIDThe 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
separateProductNameThe 'Product name' of the Unity product to import files from
separateFilePrefixThe 'Save filename' field of the AC project to import files from, as set in the Settings Manager
Returns
A List of SaveFile instances, with each instance storing information about each found save file

Implements AC.iSaveFileHandler.

◆ GatherSaveFiles()

virtual List<SaveFile> AC.SaveFileHandler_PlayerPrefs.GatherSaveFiles ( int  profileID)
virtual

Reads the disk for all save files associated with a given profile

Parameters
profileIDThe ID number of the profile to search save files for, or 0 if profiles are not enabled
Returns
A List of SaveFile instances, with each instance storing information about each found save file

Implements AC.iSaveFileHandler.

◆ GetDefaultSaveLabel()

virtual string AC.SaveFileHandler_PlayerPrefs.GetDefaultSaveLabel ( int  saveID)
virtual

Returns the default label of a save file. This is not the same as the filename - it is what's displayed in SavesList menus

Parameters
saveIDThe ID number of the save game
Returns
The save file's default label

Implements AC.iSaveFileHandler.

◆ GetSaveFile()

virtual SaveFile AC.SaveFileHandler_PlayerPrefs.GetSaveFile ( int  saveID,
int  profileID 
)
virtual

Reads the disk for a save file with a specific ID

Parameters
saveIDThe ID number of the save to search for
profileIDThe ID number of the save file's associated profile, or 0 if profiles are not enabled
Returns
A SaveFile instances, if the save was found

Implements AC.iSaveFileHandler.

◆ Load()

virtual void AC.SaveFileHandler_PlayerPrefs.Load ( SaveFile  saveFile,
bool  doLog,
System.Action< SaveFile, string >  callback 
)
virtual

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.

Parameters
saveFileThe SaveFile container which stores information about the save to load
doLogIf True, a log should be shown in the Console once the data has been read
callbackA callback containing the SaveFile, and the save-data string

Implements AC.iSaveFileHandler.

◆ Save()

virtual void AC.SaveFileHandler_PlayerPrefs.Save ( SaveFile  saveFile,
string  dataToSave,
System.Action< bool >  callback 
)
virtual

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.

Parameters
saveFileThe SaveFile container which stores information about the file. Note that only the saveID, profileID and label have been correctly assigned by this point
dataToSaveThe data to save, as a serialized string
callbackA callback containing a bool that's True if the save was successful

Implements AC.iSaveFileHandler.

◆ SaveScreenshot()

virtual void AC.SaveFileHandler_PlayerPrefs.SaveScreenshot ( SaveFile  saveFile)
virtual

Saves a screenshot associated with a save file

Parameters
saveFileA data container for both the texture, and the associate save/profile IDs

Implements AC.iSaveFileHandler.

◆ SupportsSaveThreading()

virtual bool AC.SaveFileHandler_PlayerPrefs.SupportsSaveThreading ( )
virtual

Returns true if threading is supported when saving to disk

Implements AC.iSaveFileHandler.