Adventure Creator  1.67.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
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.
 
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...
 
string GetLabel ()
 Generates a label that represents the name of the parameter's value, if appropriate More...
 
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...
 

Public Attributes

string label = ""
 
int ID = 0
 
ParameterType parameterType = ParameterType.GameObject
 
int intValue = -1
 
float floatValue = 0f
 
string stringValue = ""
 
GameObject gameObject
 
Object objectValue
 
Vector3 vector3Value
 
GameObjectParameterReferences gameObjectParameterReferences = GameObjectParameterReferences.ReferencePrefab
 

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/2]

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/2]

AC.ActionParameter.ActionParameter ( int  id)

A Constructor that sets the ID number explicitly.

Parameters
idThe unique identifier to assign

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<summary>

◆ 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 ( 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() [2/7]

void AC.ActionParameter.SetValue ( float  _value)

Sets the floatValue that the parameter assigns

Parameters
_valueThe new value, if parameterType = ParameterType.Float

◆ SetValue() [3/7]

void AC.ActionParameter.SetValue ( string  _value)

Sets the stringValue that the parameter assigns

Parameters
_valueThe new value, if parameterType = ParameterType.String

◆ SetValue() [4/7]

void AC.ActionParameter.SetValue ( Vector3  _value)

Sets the vector3Value that the parameter assigns

Parameters
_valueThe new value, if parameterType = ParameterType.Vector3

◆ SetValue() [5/7]

void AC.ActionParameter.SetValue ( GameObject  _object)

Sets the gameObject that the parameter assigns

Parameters
_objectThe new GameObject, if parameterType = ParameterType.GameObject

◆ SetValue() [6/7]

void AC.ActionParameter.SetValue ( Object  _object)

Sets the objectValue that the parameter assigns

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

◆ SetValue() [7/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

Member Data Documentation

◆ 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. 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)

◆ stringValue

string AC.ActionParameter.stringValue = ""

The new value, if parameterType = ParameterType.String

◆ vector3Value

Vector3 AC.ActionParameter.vector3Value

The new value, if parameterType = ParameterType.Vector3