Adventure Creator  1.74.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2019
AC.ActionVarCheck Class Reference
Inheritance diagram for AC.ActionVarCheck:
AC.ActionCheck AC.Action

Public Member Functions

override void AssignValues (List< ActionParameter > parameters)
 Overwrites any appropriate variables with values set using parameters, or from ConstantID numbers. More...
 
override void AssignParentList (ActionList actionList)
 Passes the ActionList that the Action is a part of to the Action class. This is run before the Action is called or displayed in an Editor. More...
 
override int GetNextOutputIndex ()
 Gets the index of the output socket to use after the Action has run. More...
 
override void ShowGUI (List< ActionParameter > parameters)
 Shows the Action's GUI when its parent ActionList / ActionListAsset uses parameters. More...
 
override string SetLabel ()
 Gets a string that is shown after the Action's title in the Editor to help the user understand what it does. More...
 
override bool ConvertLocalVariableToGlobal (int oldLocalID, int newGlobalID)
 Converts the Action's references from a given local variable to a given global variable More...
 
override bool ConvertGlobalVariableToLocal (int oldGlobalID, int newLocalID, bool isCorrectScene)
 Converts the Action's references from a given global variable to a given local variable More...
 
override int GetVariableReferences (List< ActionParameter > parameters, VariableLocation _location, int varID, Variables _variables, int _variablesConstantID=0)
 
override void AssignConstantIDs (bool saveScriptsToo, bool fromAssetFile)
 Called when an ActionList has been converted from a scene-based object to an asset file. Within it, AssignConstantID should be called for each of the Action's Constant ID numbers, which will assign a new number if one does not already exist, based on the referenced scene object. More...
 
override bool ReferencesObjectOrID (GameObject gameObject, int id)
 Checks if the Action makes reference to a particular GameObject More...
 
- Public Member Functions inherited from AC.ActionCheck
virtual bool CheckCondition ()
 Works out which of the two outputs should be run when this Action is complete. More...
 
override void Upgrade ()
 
void SetOutputs (ActionEnd actionEndOnPass, ActionEnd actionEndOnFail)
 Update the Action's output sockets More...
 
- Public Member Functions inherited from AC.Action
 Action ()
 
virtual float Run ()
 Runs the Action. More...
 
virtual void Skip ()
 
void PrintComment (ActionList actionList, ActionListAsset actionListAsset=null)
 Prints the Action's comment, if applicable, to the Console. More...
 
void SetOutputs (ActionEnd[] actionEnds)
 Update the Action's output sockets More...
 
virtual void ShowGUI ()
 
void SkipActionGUI (List< Action > actions, bool showGUI)
 
void DrawOutWires (List< Action > actions, int i, int offset, Vector2 scrollPosition)
 
int FieldToID< T > (T field, int _constantID, bool alwaysAssign=false)
 
int FieldToID (Collider field, int _constantID)
 
void AddSaveScript< T > (Behaviour field)
 
void AddSaveScript< T > (GameObject _gameObject)
 
void AssignConstantID< T > (T field, int _constantID, int _parameterID)
 
void AssignConstantID (Collider field, int _constantID, int _parameterID)
 
void AssignConstantID (Transform field, int _constantID, int _parameterID)
 
void AssignConstantID (GameObject field, int _constantID, int _parameterID)
 
IDToField< T > (T field, int _constantID, bool moreInfo)
 
Collider IDToField (Collider field, int _constantID, bool moreInfo)
 
int FieldToID (Transform field, int _constantID, bool alwaysAssign=false)
 
Transform IDToField (Transform field, int _constantID, bool moreInfo)
 
int FieldToID (GameObject field, int _constantID)
 
int FieldToID (GameObject field, int _constantID, bool alwaysAssign)
 
GameObject IDToField (GameObject field, int _constantID, bool moreInfo)
 
GameObject IDToField (GameObject field, int _constantID, bool moreInfo, bool alwaysShow)
 
virtual int GetVariableReferences (List< ActionParameter > parameters, VariableLocation location, int varID, int variablesConstantID=0)
 Gets the number of references the Action makes to a local or global variable More...
 
virtual int GetInventoryReferences (List< ActionParameter > parameters, int invID)
 
virtual int GetMenuReferences (string menuTitle, string elementTitle="")
 
virtual int GetDocumentReferences (List< ActionParameter > parameters, int documentID)
 
virtual int GetObjectiveReferences (int objectiveID)
 
virtual bool ReferencesAsset (ActionListAsset actionListAsset)
 Checks if the Action makes reference to a particular ActionList asset More...
 
virtual bool ReferencesPlayer (int playerID=-1)
 Checks if the Action makes reference to a particular ActionList asset More...
 
virtual void AssignValues ()
 
virtual void Reset (ActionList actionList)
 Resets any runtime values that are necessary to run the Action succesfully More...
 
BoolValue AssignBoolean (List< ActionParameter > parameters, int _parameterID, BoolValue field)
 Replaces a boolean based on an ActionParameter, if appropriate. More...
 
int AssignInteger (List< ActionParameter > parameters, int _parameterID, int field)
 Replaces an integer based on an ActionParameter, if appropriate. More...
 
float AssignFloat (List< ActionParameter > parameters, int _parameterID, float field)
 Replaces a float based on an ActionParameter, if appropriate. More...
 
Transform AssignFile (List< ActionParameter > parameters, int _parameterID, int _constantID, Transform field)
 Replaces a Transform based on an ActionParameter or ConstantID instance, if appropriate. More...
 
Collider AssignFile (List< ActionParameter > parameters, int _parameterID, int _constantID, Collider field)
 Replaces a Collider based on an ActionParameter or ConstantID instance, if appropriate. More...
 
Object AssignObject< T > (List< ActionParameter > parameters, int _parameterID, Object field)
 Replaces a GameObject based on an ActionParameter or ConstantID instance, if appropriate. More...
 
AssignFile< T > (List< ActionParameter > parameters, int _parameterID, int _constantID, T field, bool doLog=true)
 Replaces a generic Behaviour based on an ActionParameter or ConstantID instance, if appropriate. More...
 
AssignFile< T > (int _constantID, T field)
 Replaces a generic Behaviour based on a ConstantID, if appropriate. More...
 
Transform AssignFile (int _constantID, Transform field)
 Replaces a Transform based on a ConstantID, if appropriate. More...
 
void FixLinkAfterDeleting (Action actionToDelete, Action targetAction, List< Action > actionList)
 
virtual void ClearIDs ()
 
void BreakPoint (int i, ActionList list)
 
virtual void SetLastResult (int _lastRunOutput)
 Updates which output was followed when the Action was last run More...
 
void ResetLastResult ()
 
void SetOutput (ActionEnd actionEnd)
 Update the Action's output socket More...
 

Static Public Member Functions

static ActionVarCheck CreateNew_Global (int globalVariableID, int checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Global integer variable More...
 
static ActionVarCheck CreateNew_Global (int globalVariableID, float checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Global float variable More...
 
static ActionVarCheck CreateNew_Global (int globalVariableID, bool checkValue=true)
 Creates a new instance of the 'Variable: Set' Action, set to check a Global boolean variable More...
 
static ActionVarCheck CreateNew_Global (int globalVariableID, Vector3 checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Global Vector3 variable More...
 
static ActionVarCheck CreateNew_Global (int globalVariableID, string checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Global string variable More...
 
static ActionVarCheck CreateNew_Local (int localVariableID, int checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Local integer variable More...
 
static ActionVarCheck CreateNew_Local (int localVariableID, float checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Local float variable More...
 
static ActionVarCheck CreateNew_Local (int localVariableID, bool checkValue=true)
 Creates a new instance of the 'Variable: Set' Action, set to check a Local boolean variable More...
 
static ActionVarCheck CreateNew_Local (int localVariableID, Vector3 checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Local Vector3 variable More...
 
static ActionVarCheck CreateNew_Local (int localVariableID, string checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Local string variable More...
 
static ActionVarCheck CreateNew_Component (Variables variables, int componentVariableID, int checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Component integer variable More...
 
static ActionVarCheck CreateNew_Component (Variables variables, int componentVariableID, float checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Component float variable More...
 
static ActionVarCheck CreateNew_Component (Variables variables, int componentVariableID, bool checkValue=true)
 Creates a new instance of the 'Variable: Set' Action, set to check a Component boolean variable More...
 
static ActionVarCheck CreateNew_Component (Variables variables, int componentVariableID, Vector3 checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Component Vector3 variable More...
 
static ActionVarCheck CreateNew_Component (Variables variables, int componentVariableID, string checkValue)
 Creates a new instance of the 'Variable: Set' Action, set to check a Component string variable More...
 
- Static Public Member Functions inherited from AC.Action
static int ChooseParameterGUI (string label, List< ActionParameter > _parameters, int _parameterID, ParameterType _expectedType, int excludeParameterID=-1, string tooltip="")
 
static int ChooseParameterGUI (string label, List< ActionParameter > _parameters, int _parameterID, ParameterType[] _expectedTypes, int excludeParameterID=-1, string tooltip="")
 
static int ChooseParameterGUI (List< ActionParameter > _parameters, int _parameterID)
 
static int FieldToID (GameObject field, int _constantID, bool alwaysAssign, bool _isAssetFile)
 
static GameObject IDToField (GameObject field, int _constantID, bool moreInfo, bool alwaysShow, bool _isAssetFile)
 
static ActionEnd GenerateStopActionEnd ()
 
static T CreateNew< T > ()
 
static Action CreateNew (string className)
 
static void EditSource (Action _action)
 

Public Attributes

int parameterID = -1
 
int variableID
 
int variableNumber
 
int checkParameterID = -1
 
GetVarMethod getVarMethod = GetVarMethod.EnteredValue
 
int compareVariableID
 
int intValue
 
float floatValue
 
IntCondition intCondition
 
bool isAdditive = false
 
BoolValue boolValue = BoolValue.True
 
BoolCondition boolCondition
 
string stringValue
 
bool checkCase = true
 
Vector3 vector3Value
 
VectorCondition vectorCondition = VectorCondition.EqualTo
 
GameObject gameObjectValue
 
Object unityObjectValue
 
VariableLocation location = VariableLocation.Global
 
Variables variables
 
int variablesConstantID = 0
 
Variables compareVariables
 
int compareVariablesConstantID = 0
 
- Public Attributes inherited from AC.Action
int id
 
bool isDisplayed
 
bool showComment
 
string comment
 
bool willWait
 
bool isRunning
 
List< ActionEndendings = new List<ActionEnd> ()
 
bool isEnabled = true
 
bool isAssetFile = false
 
bool isMarked = false
 
bool isBreakPoint = false
 
Color overrideColor = Color.white
 
bool showOutputSockets = true
 
ActionList parentActionListInEditor = null
 

Protected Member Functions

bool CheckCondition (GVar _var, GVar _compareVar)
 
int ShowVarSelectorGUI (List< GVar > vars, int ID, string label)
 
int GetVarNumber (List< GVar > vars, int ID)
 
- Protected Member Functions inherited from AC.ActionCheck
override string GetSocketLabel (int index)
 
- Protected Member Functions inherited from AC.Action
void AfterRunningOption ()
 
void SkipActionGUI (ActionEnd ending, List< Action > actions, bool showGUI)
 
int ChoosePlayerGUI (int _playerID, bool includeActiveOption=false)
 
Player AssignPlayer (int _playerID, List< ActionParameter > parameters, int _playerParameterID)
 
void Log (string message, Object context=null)
 
void LogWarning (string message, Object context=null)
 
void LogError (string message, Object context=null)
 
ActionParameter GetParameterWithID (List< ActionParameter > parameters, int _id)
 
string AssignString (List< ActionParameter > parameters, int _parameterID, string field)
 
Vector3 AssignVector3 (List< ActionParameter > parameters, int _parameterID, Vector3 field)
 
int AssignVariableID (List< ActionParameter > parameters, int _parameterID, int field)
 
GVar AssignVariable (List< ActionParameter > parameters, int _parameterID, GVar field)
 
Variables AssignVariablesComponent (List< ActionParameter > parameters, int _parameterID, Variables field)
 
int AssignInvItemID (List< ActionParameter > parameters, int _parameterID, int field)
 
int AssignDocumentID (List< ActionParameter > parameters, int _parameterID, int field)
 
GameObject AssignFile (List< ActionParameter > parameters, int _parameterID, int _constantID, GameObject field)
 Replaces a GameObject based on an ActionParameter or ConstantID instance, if appropriate. More...
 
GameObject AssignFile (int _constantID, GameObject field)
 Replaces a GameObject based on a ConstantID, if appropriate. More...
 
ActionEnd GenerateActionEnd (ResultAction _resultAction, ActionListAsset _linkedAsset, Cutscene _linkedCutscene, int _skipAction, Action _skipActionActual, List< Action > _actions)
 

Protected Attributes

GameObject runtimeGameObjectValue
 
Object runtimeUnityObjectValue
 
LocalVariables localVariables
 
GVar runtimeVariable
 
GVar runtimeCompareVariable
 
VariableType placeholderType
 
int placeholderPopUpLabelDataID = 0
 
- Protected Attributes inherited from AC.Action
ActionCategory category = ActionCategory.Custom
 
string title = "Untitled"
 
string description
 

Properties

override ActionCategory Category [get]
 
override string Title [get]
 
override string Description [get]
 
- Properties inherited from AC.ActionCheck
override int NumSockets [get]
 
- Properties inherited from AC.Action
virtual ActionCategory Category [get]
 
virtual string Title [get]
 
virtual string Description [get]
 
virtual int NumSockets [get]
 
virtual bool RunAllOutputs [get]
 
float defaultPauseTime [get]
 
int LastRunOutput [get]
 
Rect NodeRect [get, set]
 

Additional Inherited Members

- Static Public Attributes inherited from AC.Action
const int skipSocketSeparation = 44
 
const int socketSeparation = 28
 

Member Function Documentation

◆ AssignConstantIDs()

override void AC.ActionVarCheck.AssignConstantIDs ( bool  saveScriptsToo,
bool  fromAssetFile 
)
virtual

Called when an ActionList has been converted from a scene-based object to an asset file. Within it, AssignConstantID should be called for each of the Action's Constant ID numbers, which will assign a new number if one does not already exist, based on the referenced scene object.

Parameters
saveScriptsTooIf True, then the Action shall attempt to add the appropriate 'Remember' script to reference GameObjects as well.
fromAssetFileIf True, then the Action is placed in an ActionListAsset file

Reimplemented from AC.Action.

◆ AssignParentList()

override void AC.ActionVarCheck.AssignParentList ( ActionList  actionList)
virtual

Passes the ActionList that the Action is a part of to the Action class. This is run before the Action is called or displayed in an Editor.

Parameters
actionListThe ActionList that the Action is contained in

Reimplemented from AC.Action.

◆ AssignValues()

override void AC.ActionVarCheck.AssignValues ( List< ActionParameter parameters)
virtual

Overwrites any appropriate variables with values set using parameters, or from ConstantID numbers.

Parameters
parametersA List of parameters that overwrite variable values

Reimplemented from AC.Action.

◆ ConvertGlobalVariableToLocal()

override bool AC.ActionVarCheck.ConvertGlobalVariableToLocal ( int  oldGlobalID,
int  newLocalID,
bool  isCorrectScene 
)
virtual

Converts the Action's references from a given global variable to a given local variable

Parameters
oldGlobalIDThe ID number of the old global variable
newLocalIDThe ID number of the new local variable
isCorrectSceneIf True, the local variable is in the same scene as this ActionList. Otherwise, no change will made, but the return value will be the same
Returns
True if the Action is affected

Reimplemented from AC.Action.

◆ ConvertLocalVariableToGlobal()

override bool AC.ActionVarCheck.ConvertLocalVariableToGlobal ( int  oldLocalID,
int  newGlobalID 
)
virtual

Converts the Action's references from a given local variable to a given global variable

Parameters
oldLocalIDThe ID number of the old local variable
newGlobalIDThe ID number of the new global variable
Returns
True if the Action was amended

Reimplemented from AC.Action.

◆ CreateNew_Component() [1/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Component ( Variables  variables,
int  componentVariableID,
bool  checkValue = true 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Component boolean variable

Parameters
variablesThe associated Variables component
componentVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Component() [2/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Component ( Variables  variables,
int  componentVariableID,
float  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Component float variable

Parameters
variablesThe associated Variables component
componentVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Component() [3/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Component ( Variables  variables,
int  componentVariableID,
int  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Component integer variable

Parameters
variablesThe associated Variables component
componentVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Component() [4/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Component ( Variables  variables,
int  componentVariableID,
string  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Component string variable

Parameters
variablesThe associated Variables component
componentVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Component() [5/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Component ( Variables  variables,
int  componentVariableID,
Vector3  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Component Vector3 variable

Parameters
variablesThe associated Variables component
componentVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Global() [1/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Global ( int  globalVariableID,
bool  checkValue = true 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Global boolean variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Global() [2/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Global ( int  globalVariableID,
float  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Global float variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Global() [3/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Global ( int  globalVariableID,
int  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Global integer variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Global() [4/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Global ( int  globalVariableID,
string  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Global string variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Global() [5/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Global ( int  globalVariableID,
Vector3  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Global Vector3 variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Local() [1/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Local ( int  localVariableID,
bool  checkValue = true 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Local boolean variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Local() [2/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Local ( int  localVariableID,
float  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Local float variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Local() [3/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Local ( int  localVariableID,
int  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Local integer variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Local() [4/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Local ( int  localVariableID,
string  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Local string variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ CreateNew_Local() [5/5]

static ActionVarCheck AC.ActionVarCheck.CreateNew_Local ( int  localVariableID,
Vector3  checkValue 
)
static

Creates a new instance of the 'Variable: Set' Action, set to check a Local Vector3 variable

Parameters
localVariableIDThe ID number of the variable
checkValueThe value to check for
Returns
The generated Action

◆ GetNextOutputIndex()

override int AC.ActionVarCheck.GetNextOutputIndex ( )
virtual

Gets the index of the output socket to use after the Action has run.

Returns
The index of the output socket to run. If the index is negative or invalid it will result in the ActionList ending

Reimplemented from AC.ActionCheck.

◆ ReferencesObjectOrID()

override bool AC.ActionVarCheck.ReferencesObjectOrID ( GameObject  gameObject,
int  id 
)
virtual

Checks if the Action makes reference to a particular GameObject

Parameters
gameObjectThe GameObject to check for
idThe GameObject's associated ConstantID value
Returns
True if the Action references the GameObject

Reimplemented from AC.Action.

◆ SetLabel()

override string AC.ActionVarCheck.SetLabel ( )
virtual

Gets a string that is shown after the Action's title in the Editor to help the user understand what it does.

Returns
A string that is shown after the Action's title in the Editor to help the user understand what it does.

Reimplemented from AC.Action.

◆ ShowGUI()

override void AC.ActionVarCheck.ShowGUI ( List< ActionParameter parameters)
virtual

Shows the Action's GUI when its parent ActionList / ActionListAsset uses parameters.

Parameters
parametersA List of parameters available in the parent ActionList / ActionListAsset

Reimplemented from AC.Action.