Adventure Creator  1.66.8
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.iOptionsFileHandler Interface Reference
Inheritance diagram for AC.iOptionsFileHandler:
AC.OptionsFileHandler_PlayerPrefs

Public Member Functions

void SaveOptions (int profileID, string dataString, bool showLog)
 Saves the OptionsData, serialized as a string, to disk. More...
 
string LoadOptions (int profileID, bool showLog)
 Loads the OptionsData, serialized as a string, from disk. More...
 
void DeleteOptions (int profileID)
 Deletes the saved OptionsData string for a given profile. More...
 
int GetActiveProfile ()
 Returns the active profile ID number, if profiles are enabled More...
 
void SetActiveProfile (int profileID)
 Records the active profile ID More...
 
bool DoesProfileExist (int profileID)
 Checks if OptionsData for a given profile is stored More...
 

Detailed Description

An interface for classes that handle the saving and loading of OptionsData. This class only handles the reading and writing of the data to and from disk - the data is already serialized as a string, and does not need processing.

To override where options data is saved, create a new class that implements iOptionsFileHandler, and assign it with:

Options.OptionsFileHandler = new MyClassName ();

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.

Member Function Documentation

◆ DeleteOptions()

void AC.iOptionsFileHandler.DeleteOptions ( int  profileID)

Deletes the saved OptionsData string for a given profile.

Parameters
profileIDThe ID number of the profile to delete</parm>

Implemented in AC.OptionsFileHandler_PlayerPrefs.

◆ DoesProfileExist()

bool AC.iOptionsFileHandler.DoesProfileExist ( int  profileID)

Checks if OptionsData for a given profile is stored

Parameters
profileIDThe ID number of the profile to check for</parm>
Returns
True if OptionsData for the given profile exists

Implemented in AC.OptionsFileHandler_PlayerPrefs.

◆ GetActiveProfile()

int AC.iOptionsFileHandler.GetActiveProfile ( )

Returns the active profile ID number, if profiles are enabled

Returns
The ID number of the active profile, or 0 if profiles are not enabled.

Implemented in AC.OptionsFileHandler_PlayerPrefs.

◆ LoadOptions()

string AC.iOptionsFileHandler.LoadOptions ( int  profileID,
bool  showLog 
)

Loads the OptionsData, serialized as a string, from disk.

Parameters
profileIDThe ID number of the profile to be loaded, or 0 if profiles are not enabled
Returns
The OptionsData, serialized as a string

Implemented in AC.OptionsFileHandler_PlayerPrefs.

◆ SaveOptions()

void AC.iOptionsFileHandler.SaveOptions ( int  profileID,
string  dataString,
bool  showLog 
)

Saves the OptionsData, serialized as a string, to disk.

Parameters
profileIDThe ID number of the profile to be saved, or 0 if profiles are not enabled
dataStringThe serialized data to save
showLogIf True, a Console message upon succesful saving is requested

Implemented in AC.OptionsFileHandler_PlayerPrefs.

◆ SetActiveProfile()

void AC.iOptionsFileHandler.SetActiveProfile ( int  profileID)

Records the active profile ID

Parameters
profileIDThe ID number of the profile to set as active</parm>

Implemented in AC.OptionsFileHandler_PlayerPrefs.