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

Public Member Functions

 ActionParameter (int[] idArray)
 A Constructor that generates a unique ID number. More...
 
 ActionParameter (int id)
 A Constructor that sets the ID number explicitly. More...
 
 ActionParameter (ActionParameter _actionParameter, bool alsoCopyValues=false)
 A Constructor that duplicates another ActionParameter. More...
 
void CopyValues (ActionParameter otherParameter)
 Copies the "value" variables from another ActionParameter, without changing the type, ID, or label. More...
 
void Reset ()
 
bool IsIntegerBased ()
 Checks if the parameter's value is an integer. This is the case if parameterType = ParameterType.GameObject, GlobalVariable, Integer, InventoryItem or LocalVariable. More...
 
void SetValue (int _value)
 Sets the intValue that the parameter assigns More...
 
void SetValue (float _value)
 Sets the floatValue that the parameter assigns More...
 
void SetValue (string _value)
 Sets the stringValue that the parameter assigns More...
 
void SetValue (Vector3 _value)
 Sets the vector3Value that the parameter assigns More...
 
void SetValue (GameObject _object)
 Sets the gameObject that the parameter assigns More...
 
void SetValue (Object _object)
 Sets the objectValue that the parameter assigns More...
 
void SetValue (GameObject _object, int _value)
 Sets the gameObject that the parameter assigns More...
 
void SetValue (Variables _variables, int _value)
 
GVar GetVariable ()
 
string GetLabel ()
 Generates a label that represents the name of the parameter's value, if appropriate More...
 
string GetValueAsString ()
 
string GetSaveData ()
 Generates a string that represents the parameter's saveable data</summar>

Returns
The data string

 
void LoadData (string dataString)
 Restores data from a data string More...
 
override string ToString ()
 
void ShowGUI (bool isAssetFile, bool onlyEditValues=false, bool readOnly=false)
 

Public Attributes

string label = ""
 
string description = ""
 
int ID = 0
 
ParameterType parameterType = ParameterType.GameObject
 
int intValue = -1
 
int constantID = 0
 
int popUpID = 0
 
float floatValue = 0f
 
string stringValue = ""
 
GameObject gameObject
 
Object objectValue
 
Vector3 vector3Value
 
GameObjectParameterReferences gameObjectParameterReferences = GameObjectParameterReferences.ReferencePrefab
 
Variables variables = null
 
bool isDisplayed = true
 

Detailed Description

A data container for an ActionList parameter. A parameter can change the value of an Action's public variables dynamically during gameplay, allowing the same Action to be repurposed for different tasks.

Constructor & Destructor Documentation

◆ ActionParameter() [1/3]

AC.ActionParameter.ActionParameter ( int[]  idArray)

A Constructor that generates a unique ID number.

Parameters
idArrayAn array of previously-used ID numbers, to ensure its own ID is unique.

◆ ActionParameter() [2/3]

AC.ActionParameter.ActionParameter ( int  id)

A Constructor that sets the ID number explicitly.

Parameters
idThe unique identifier to assign

◆ ActionParameter() [3/3]

AC.ActionParameter.ActionParameter ( ActionParameter  _actionParameter,
bool  alsoCopyValues = false 
)

A Constructor that duplicates another ActionParameter.

Member Function Documentation

◆ CopyValues()

void AC.ActionParameter.CopyValues ( ActionParameter  otherParameter)

Copies the "value" variables from another ActionParameter, without changing the type, ID, or label.

<parameter name="otherParameter">The ActionParameter to copy from

◆ GetLabel()

string AC.ActionParameter.GetLabel ( )

Generates a label that represents the name of the parameter's value, if appropriate

Returns

A label that represents the name of the parameter's value

◆ GetValueAsString()

string AC.ActionParameter.GetValueAsString ( )

Gets the parameters value formatted to a string

◆ IsIntegerBased()

bool AC.ActionParameter.IsIntegerBased ( )

Checks if the parameter's value is an integer. This is the case if parameterType = ParameterType.GameObject, GlobalVariable, Integer, InventoryItem or LocalVariable.

Returns
True if the parameter's value is an integer.

◆ LoadData()

void AC.ActionParameter.LoadData ( string  dataString)

Restores data from a data string

Parameters
dataStringThe data

◆ Reset()

void AC.ActionParameter.Reset ( )

Resets the value that the parameter assigns.

◆ SetValue() [1/7]

void AC.ActionParameter.SetValue ( float  _value)

Sets the floatValue that the parameter assigns

Parameters
_valueThe new value, if parameterType = ParameterType.Float

◆ SetValue() [2/7]

void AC.ActionParameter.SetValue ( GameObject  _object)

Sets the gameObject that the parameter assigns

Parameters
_objectThe new GameObject, if parameterType = ParameterType.GameObject

◆ SetValue() [3/7]

void AC.ActionParameter.SetValue ( GameObject  _object,
int  _value 
)

Sets the gameObject that the parameter assigns

Parameters
_objectThe new GameObject, if parameterType = ParameterType.GameObject
_valueThe GameObject's ConstantID number, which is used to find the GameObject if it is not always in the same scene as the ActionParameter class

◆ SetValue() [4/7]

void AC.ActionParameter.SetValue ( int  _value)

Sets the intValue that the parameter assigns

Parameters
_valueThe new value or ID number, if parameterType = ParameterType.Integer / Boolean / LocalVariable / GlobalVariable / InventoryItem. If parameterType = ParameterType.GameObject, it is the ConstantID number of the GameObject if it is not currently accessible

◆ SetValue() [5/7]

void AC.ActionParameter.SetValue ( Object  _object)

Sets the objectValue that the parameter assigns

Parameters
_objectThe new Unity Object, if parameterType = ParameterType.UnityObject

◆ SetValue() [6/7]

void AC.ActionParameter.SetValue ( string  _value)

Sets the stringValue that the parameter assigns

Parameters
_valueThe new value, if parameterType = ParameterType.String

◆ SetValue() [7/7]

void AC.ActionParameter.SetValue ( Vector3  _value)

Sets the vector3Value that the parameter assigns

Parameters
_valueThe new value, if parameterType = ParameterType.Vector3

Member Data Documentation

◆ constantID

int AC.ActionParameter.constantID = 0

The constant ID number of the Variables component, if parameterType = ParameterType.ComponentVariabel

◆ description

string AC.ActionParameter.description = ""

A description to display as a tooltip when setting its value externally

◆ floatValue

float AC.ActionParameter.floatValue = 0f

The new value, if parameterType = ParameterType.Float

◆ gameObject

GameObject AC.ActionParameter.gameObject

The new value, if parameterType = ParameterType.GameObject

◆ gameObjectParameterReferences

GameObjectParameterReferences AC.ActionParameter.gameObjectParameterReferences = GameObjectParameterReferences.ReferencePrefab

If a prefab is passed between assets as a GameObject parameter, what should ultimately be referenced (ReferencePrefab, ReferenceSceneInstance)

◆ ID

int AC.ActionParameter.ID = 0

A unique identifier

◆ intValue

int AC.ActionParameter.intValue = -1

The new value or ID number, if parameterType = ParameterType.Integer / Boolean / LocalVariable / GlobalVariable / InventoryItem / Document / ComponentVariable / PopUp. If parameterType = ParameterType.GameObject, it is the ConstantID number of the GameObject if it is not currently accessible

◆ label

string AC.ActionParameter.label = ""

The display name in the Editor

◆ objectValue

Object AC.ActionParameter.objectValue

The new value, if parameterType = ParameterType.UnityObject

◆ parameterType

ParameterType AC.ActionParameter.parameterType = ParameterType.GameObject

The type of variable it overrides (GameObject, InventoryItem, GlobalVariable, LocalVariable, String, Float, Integer, Boolean, Vector3, Document, ComponentVariable, Parameter)

◆ popUpID

int AC.ActionParameter.popUpID = 0

The Preset ID for the popup, if parameterType = ParameterType.PopUp

◆ stringValue

string AC.ActionParameter.stringValue = ""

The new value, if parameterType = ParameterType.String

◆ vector3Value

Vector3 AC.ActionParameter.vector3Value

The new value, if parameterType = ParameterType.Vector3