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

Static Public Member Functions

static List< GVarGetAllVars ()
 Returns a list of all global variables. More...
 
static void BackupAll ()
 
static void UploadAll ()
 
static void DownloadAll ()
 
static GVar GetVariable (int _id, bool synchronise=false)
 Returns a global variable. More...
 
static GVar GetVariable (string _name, bool synchronise=false)
 Returns a global variable. More...
 
static int GetIntegerValue (int _id, bool synchronise=true)
 Returns the value of a global Integer variable. More...
 
static bool GetBooleanValue (int _id, bool synchronise=true)
 Returns the value of a global Boolean variable. More...
 
static string GetStringValue (int _id, bool synchronise=true, int languageNumber=0)
 Returns the value of a global String variable. More...
 
static float GetFloatValue (int _id, bool synchronise=true)
 Returns the value of a global Float variable. More...
 
static Vector3 GetVector3Value (int _id, bool synchronise=true)
 Returns the value of a global Vector3 variable. More...
 
static string GetPopupValue (int _id, bool synchronise=true, int languageNumber=0)
 Returns the value of a global Popup variable. More...
 
static void SetIntegerValue (int _id, int _value, bool synchronise=true)
 Sets the value of a global Integer variable. More...
 
static void SetBooleanValue (int _id, bool _value, bool synchronise=true)
 Sets the value of a global Boolean variable. More...
 
static void SetStringValue (int _id, string _value, bool synchronise=true)
 Sets the value of a global String variable. More...
 
static void SetFloatValue (int _id, float _value, bool synchronise=true)
 Sets the value of a global Float variable. More...
 
static void SetVector3Value (int _id, Vector3 _value, bool synchronise=true)
 Sets the value of a global Vector3 variable. More...
 
static void SetPopupValue (int _id, int _value, bool synchronise=true)
 Sets the value of a global PopUp variable. More...
 

Detailed Description

A class that can manipulate and retrieve the game's Global Variables at runtime.

Member Function Documentation

◆ BackupAll()

static void AC.GlobalVariables.BackupAll ( )
static

Backs up the values of all global variables. Necessary when skipping ActionLists that involve checking variable values.

◆ DownloadAll()

static void AC.GlobalVariables.DownloadAll ( )
static

Downloads the values of all linked variables from their linked counterparts.

◆ GetAllVars()

static List<GVar> AC.GlobalVariables.GetAllVars ( )
static

Returns a list of all global variables.

Returns
A List of GVar variables

◆ GetBooleanValue()

static bool AC.GlobalVariables.GetBooleanValue ( int  _id,
bool  synchronise = true 
)
static

Returns the value of a global Boolean variable.

Parameters
_idThe ID number of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.
Returns
The bool value of the variable

◆ GetFloatValue()

static float AC.GlobalVariables.GetFloatValue ( int  _id,
bool  synchronise = true 
)
static

Returns the value of a global Float variable.

Parameters
_idThe ID number of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.
Returns
The float value of the variable

◆ GetIntegerValue()

static int AC.GlobalVariables.GetIntegerValue ( int  _id,
bool  synchronise = true 
)
static

Returns the value of a global Integer variable.

Parameters
_idThe ID number of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.
Returns
The integer value of the variable

◆ GetPopupValue()

static string AC.GlobalVariables.GetPopupValue ( int  _id,
bool  synchronise = true,
int  languageNumber = 0 
)
static

Returns the value of a global Popup variable.

Parameters
_idThe ID number of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.
languageNumberThe index number of the game's current language
Returns
The string value of the variable

◆ GetStringValue()

static string AC.GlobalVariables.GetStringValue ( int  _id,
bool  synchronise = true,
int  languageNumber = 0 
)
static

Returns the value of a global String variable.

Parameters
_idThe ID number of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.
languageNumberThe index number of the game's current language
Returns
The string value of the variable

◆ GetVariable() [1/2]

static GVar AC.GlobalVariables.GetVariable ( int  _id,
bool  synchronise = false 
)
static

Returns a global variable.

Parameters
_idThe ID number of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.
Returns
The global variable, or null if it was not found

◆ GetVariable() [2/2]

static GVar AC.GlobalVariables.GetVariable ( string  _name,
bool  synchronise = false 
)
static

Returns a global variable.

Parameters
_nameThe name of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.
Returns
The global variable, or null if it was not found

◆ GetVector3Value()

static Vector3 AC.GlobalVariables.GetVector3Value ( int  _id,
bool  synchronise = true 
)
static

Returns the value of a global Vector3 variable.

Parameters
_idThe ID number of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.
Returns
The Vector3 value of the variable

◆ SetBooleanValue()

static void AC.GlobalVariables.SetBooleanValue ( int  _id,
bool  _value,
bool  synchronise = true 
)
static

Sets the value of a global Boolean variable.

Parameters
_idThe ID number of the variable
_valueThe new bool value of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.

◆ SetFloatValue()

static void AC.GlobalVariables.SetFloatValue ( int  _id,
float  _value,
bool  synchronise = true 
)
static

Sets the value of a global Float variable.

Parameters
_idThe ID number of the variable
_valueThe new float value of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.

◆ SetIntegerValue()

static void AC.GlobalVariables.SetIntegerValue ( int  _id,
int  _value,
bool  synchronise = true 
)
static

Sets the value of a global Integer variable.

Parameters
_idThe ID number of the variable
_valueThe new integer value of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.

◆ SetPopupValue()

static void AC.GlobalVariables.SetPopupValue ( int  _id,
int  _value,
bool  synchronise = true 
)
static

Sets the value of a global PopUp variable.

Parameters
_idThe ID number of the variable
_valueThe new index value of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.

◆ SetStringValue()

static void AC.GlobalVariables.SetStringValue ( int  _id,
string  _value,
bool  synchronise = true 
)
static

Sets the value of a global String variable.

Parameters
_idThe ID number of the variable
_valueThe new string value of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.

◆ SetVector3Value()

static void AC.GlobalVariables.SetVector3Value ( int  _id,
Vector3  _value,
bool  synchronise = true 
)
static

Sets the value of a global Vector3 variable.

Parameters
_idThe ID number of the variable
_valueThe new float value of the variable
synchroniseIf True, then the variable's value will be synchronised with any external link it may have.

◆ UploadAll()

static void AC.GlobalVariables.UploadAll ( )
static

Uploads the values all linked variables to their linked counterparts.