EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Nodes.Logic.TriggerScriptNode Class Reference

A node for triggering script methods. More...

Inherits EasyTalk.Nodes.Core.Node, EasyTalk.Nodes.Core.DialogueFlowNode, and EasyTalk.Nodes.Core.FunctionalNode.

Public Member Functions

 TriggerScriptNode ()
 Creates a new TriggerScriptNode.
 
object TriggerScript (NodeHandler nodeHandler, Dictionary< int, object > nodeOutputValues, GameObject convoOwner=null)
 Triggers the script as defined by the node.
 
NodeConnection GetFlowInput ()
 Returns the dialogue flow input for the node.
Returns
The dialogue flow input for the node.

 
NodeConnection GetFlowOutput ()
 Returns the dialogue flow output for the node.
Returns
The dialogue flow output for the node.

 
void DetermineAndStoreValue (NodeHandler nodeHandler, Dictionary< int, object > nodeValues, GameObject convoOwner=null)
 Determines the value of this node and stores it in the provided Dictionary of node and connection IDs to values.
Parameters
nodeHandlerThe node handler being used.
nodeValuesA mapping between node or connection IDs and the values attributed to them.
convoOwnerThe GameObject which on which the dialogue logic is currently running.

 
bool HasDependencies ()
 Returns whether the node is dependent on values coming into input connections.
Returns
Whether the node has dependencies.

 
List< int > GetDependencyOutputIDs ()
 Returns a List of IDs for output connections that this node is dependent on in order to evaluate itself and determine the value to store.
Returns
The List of output connections that this node is dependent on.

 
- Public Member Functions inherited from EasyTalk.Nodes.Core.Node
void AddInput (NodeConnection input)
 Adds the provided input connection to the node's inputs.
 
void AddOutput (NodeConnection output)
 Adds the provided output connection to the node's outputs.
 
NodeConnection AddInput (InputOutputType connectionType)
 Adds a new input connection of the specified type to the node's inputs.
 
NodeConnection AddOutput (InputOutputType connectionType)
 Adds a new output connection of the specified type to the node's outputs.
 
NodeConnection FindOutputOfType (InputOutputType outputType)
 Finds the first output which matches the specified output type.
 
NodeConnection FindInputOfType (InputOutputType inputType)
 Finds the first input which matches the specified input type.
 
bool HasConnectedInputs ()
 Returns true if this node has inputs which are connected to other node outputs.
 
bool HasConnectedOutputs ()
 Returns true if this node has outputs which are connected to other node inputs.
 
List< int > FindDependencyOutputIDs ()
 Finds and returns a List of all output IDs which are connected to this node's value (non-dialogue-flow) inputs.
 
string GetJSON ()
 Returns a JSON string representation of the node.
 

Static Public Member Functions

static Type GetTypeForString (string simpleTypeName)
 Returns the actual Type for the simplified type string provided.
 
static object ConvertToType (object obj, Type type)
 Attempts to convert the object value provided to the specified Type.
 
- Static Public Member Functions inherited from EasyTalk.Nodes.Core.Node
static Node Deserialize (string json)
 Deserializes a Node from the specified JSON string.
 

Properties

string TriggeredClassName [get, set]
 Gets or sets the class name to trigger a method on.
 
string TriggeredMethodName [get, set]
 Gets or sets the name of the method to trigger.
 
string MethodSignature [get, set]
 Gets or sets the string representation of the method signature for the method to be triggered.
 
string[] ParameterTypes [get, set]
 Gets or sets the type names for the parameters passed into the method to be triggered.
 
string[] ParameterValues [get, set]
 Gets or sets the parameter values to pass into the method to be triggered.
 
string TriggerTypeString [get, set]
 Gets or sets the mode or type of method to trigger (from a string equivalent to a TriggerFilterType toString() value).
 
TriggerFilterType TriggerType [get, set]
 Gets or sets the mode or type of method to trigger.
 
string ObjectTagOrName [get, set]
 Gets or sets the name or tag of the GameObject to use when triggering the method.
 
- Properties inherited from EasyTalk.Nodes.Core.Node
int ID [get, set]
 Gets or sets the node ID.
 
string NodeTypeString [get, set]
 Gets or sets the node type string.
 
float XPosition [get, set]
 Gets or sets the X position of the node.
 
float YPosition [get, set]
 Gets or sets the Y position of the node.
 
string Name [get, set]
 Gets or sets the name of the node.
 
float Width [get, set]
 Gets or sets the width of the node.
 
float Height [get, set]
 Gets or sets the height of the node.
 
NodeType NodeType [get, set]
 Gets or sets the node type.
 
List< NodeConnectionInputs [get, set]
 Gets or sets the List of input connections of the node.
 
List< NodeConnectionOutputs [get, set]
 Gets or sets the List of output connections of the node.
 

Private Member Functions

object[] DetermineParameterValues (NodeHandler nodeHandler, Dictionary< int, object > nodeOutputValues, Type[] paramTypes)
 Determines the values for each parameter to pass to the method to be called.
 
Type[] GetParameterTypes ()
 Returns an array of Types to use for the parameters of the method to be called.
 

Private Attributes

string triggeredClassName
 The name of the class to trigger a method on.
 
string triggeredMethodName
 The name of the method to trigger.
 
string methodSignature
 A string representation of the method signature for the triggered method.
 
string[] parameterTypes
 The type names for each parameter required for the triggered method.
 
string[] parameterValues
 The values to pass into the triggered method.
 
TriggerFilterType triggerType = TriggerFilterType.SELF
 The mode or type of method to trigger.
 
string objectTagOrName
 The name of the GameObject or the tag of the GameObject to trigger the method on.
 

Additional Inherited Members

- Protected Member Functions inherited from EasyTalk.Nodes.Core.Node
List< NodeConnectionFindFlowInputs ()
 Finds and returns a List of all inputs which are dialogue flow inputs.
 
List< NodeConnectionFindFlowOutputs ()
 Finds and returns a List of all outputs which are dialogue flow outputs.
 
- Protected Attributes inherited from EasyTalk.Nodes.Core.Node
int nodeId = NodeUtils.NextID()
 The ID of the node.
 
string name
 The name of the node.
 
NodeType nodeType
 The type of the node.
 
List< NodeConnectioninputs = new List<NodeConnection>()
 A List of input connections of the node.
 
List< NodeConnectionoutputs = new List<NodeConnection>()
 A List of output connections of the node.
 

Detailed Description

A node for triggering script methods.

Constructor & Destructor Documentation

◆ TriggerScriptNode()

EasyTalk.Nodes.Logic.TriggerScriptNode.TriggerScriptNode ( )

Creates a new TriggerScriptNode.

Member Function Documentation

◆ ConvertToType()

static object EasyTalk.Nodes.Logic.TriggerScriptNode.ConvertToType ( object obj,
Type type )
static

Attempts to convert the object value provided to the specified Type.

Parameters
objThe object to convert.
typeThe Type to convert the provided object to.
Returns
The converted value.

◆ DetermineAndStoreValue()

void EasyTalk.Nodes.Logic.TriggerScriptNode.DetermineAndStoreValue ( NodeHandler nodeHandler,
Dictionary< int, object > nodeValues,
GameObject convoOwner = null )

Determines the value of this node and stores it in the provided Dictionary of node and connection IDs to values.

Parameters
nodeHandlerThe node handler being used.
nodeValuesA mapping between node or connection IDs and the values attributed to them.
convoOwnerThe GameObject which on which the dialogue logic is currently running.

Implements EasyTalk.Nodes.Core.FunctionalNode.

◆ DetermineParameterValues()

object[] EasyTalk.Nodes.Logic.TriggerScriptNode.DetermineParameterValues ( NodeHandler nodeHandler,
Dictionary< int, object > nodeOutputValues,
Type[] paramTypes )
private

Determines the values for each parameter to pass to the method to be called.

Parameters
nodeHandlerThe node handler currently processing dialogue.
nodeOutputValuesA mapping of node IDs and connection IDs to the corresponding output values attributed to those IDs.
paramTypesThe GameObject which is currently running the dialogue.
Returns
Returns an array of values to use for each parameter.

◆ GetDependencyOutputIDs()

List< int > EasyTalk.Nodes.Logic.TriggerScriptNode.GetDependencyOutputIDs ( )

Returns a List of IDs for output connections that this node is dependent on in order to evaluate itself and determine the value to store.

Returns
The List of output connections that this node is dependent on.

Implements EasyTalk.Nodes.Core.FunctionalNode.

◆ GetFlowInput()

NodeConnection EasyTalk.Nodes.Logic.TriggerScriptNode.GetFlowInput ( )

Returns the dialogue flow input for the node.

Returns
The dialogue flow input for the node.

Implements EasyTalk.Nodes.Core.DialogueFlowNode.

◆ GetFlowOutput()

NodeConnection EasyTalk.Nodes.Logic.TriggerScriptNode.GetFlowOutput ( )

Returns the dialogue flow output for the node.

Returns
The dialogue flow output for the node.

Implements EasyTalk.Nodes.Core.DialogueFlowNode.

◆ GetParameterTypes()

Type[] EasyTalk.Nodes.Logic.TriggerScriptNode.GetParameterTypes ( )
private

Returns an array of Types to use for the parameters of the method to be called.

Returns
An array of the parameter Types to pass into the called method.

◆ GetTypeForString()

static Type EasyTalk.Nodes.Logic.TriggerScriptNode.GetTypeForString ( string simpleTypeName)
static

Returns the actual Type for the simplified type string provided.

Parameters
simpleTypeNameA simplified type name.
Returns
The Type attributed to the simple type name specified.

◆ HasDependencies()

bool EasyTalk.Nodes.Logic.TriggerScriptNode.HasDependencies ( )

Returns whether the node is dependent on values coming into input connections.

Returns
Whether the node has dependencies.

Implements EasyTalk.Nodes.Core.FunctionalNode.

◆ TriggerScript()

object EasyTalk.Nodes.Logic.TriggerScriptNode.TriggerScript ( NodeHandler nodeHandler,
Dictionary< int, object > nodeOutputValues,
GameObject convoOwner = null )

Triggers the script as defined by the node.

Parameters
nodeHandlerThe node handler currently processing dialogue.
nodeOutputValuesA mapping of node IDs and connection IDs to the corresponding output values attributed to those IDs.
convoOwnerThe GameObject which is currently running the dialogue.
Returns
Returns the result of the method.

Member Data Documentation

◆ methodSignature

string EasyTalk.Nodes.Logic.TriggerScriptNode.methodSignature
private

A string representation of the method signature for the triggered method.

◆ objectTagOrName

string EasyTalk.Nodes.Logic.TriggerScriptNode.objectTagOrName
private

The name of the GameObject or the tag of the GameObject to trigger the method on.

◆ parameterTypes

string [] EasyTalk.Nodes.Logic.TriggerScriptNode.parameterTypes
private

The type names for each parameter required for the triggered method.

◆ parameterValues

string [] EasyTalk.Nodes.Logic.TriggerScriptNode.parameterValues
private

The values to pass into the triggered method.

◆ triggeredClassName

string EasyTalk.Nodes.Logic.TriggerScriptNode.triggeredClassName
private

The name of the class to trigger a method on.

◆ triggeredMethodName

string EasyTalk.Nodes.Logic.TriggerScriptNode.triggeredMethodName
private

The name of the method to trigger.

◆ triggerType

TriggerFilterType EasyTalk.Nodes.Logic.TriggerScriptNode.triggerType = TriggerFilterType.SELF
private

The mode or type of method to trigger.

Property Documentation

◆ MethodSignature

string EasyTalk.Nodes.Logic.TriggerScriptNode.MethodSignature
getset

Gets or sets the string representation of the method signature for the method to be triggered.

◆ ObjectTagOrName

string EasyTalk.Nodes.Logic.TriggerScriptNode.ObjectTagOrName
getset

Gets or sets the name or tag of the GameObject to use when triggering the method.

◆ ParameterTypes

string [] EasyTalk.Nodes.Logic.TriggerScriptNode.ParameterTypes
getset

Gets or sets the type names for the parameters passed into the method to be triggered.

◆ ParameterValues

string [] EasyTalk.Nodes.Logic.TriggerScriptNode.ParameterValues
getset

Gets or sets the parameter values to pass into the method to be triggered.

◆ TriggeredClassName

string EasyTalk.Nodes.Logic.TriggerScriptNode.TriggeredClassName
getset

Gets or sets the class name to trigger a method on.

◆ TriggeredMethodName

string EasyTalk.Nodes.Logic.TriggerScriptNode.TriggeredMethodName
getset

Gets or sets the name of the method to trigger.

◆ TriggerType

TriggerFilterType EasyTalk.Nodes.Logic.TriggerScriptNode.TriggerType
getset

Gets or sets the mode or type of method to trigger.

◆ TriggerTypeString

string EasyTalk.Nodes.Logic.TriggerScriptNode.TriggerTypeString
getset

Gets or sets the mode or type of method to trigger (from a string equivalent to a TriggerFilterType toString() value).