Class ProcessorNode
Interface for any node that can be used to process something. It can either consume or provide data or both.
Inheritance
ProcessorNode
Syntax
[Serializable]
public abstract class ProcessorNode : ScriptNode, IProcessorNode, IProviderNode, IConsumerNode, IScriptNode, INode
Constructors
ProcessorNode()
Declaration
protected ProcessorNode()
ProcessorNode(ScriptGraphGraph)
Declaration
[Obsolete("Processor nodes needn't be dependant on a graph anymore. You can use the parameterless constructor instead. This one will be removed with version 2.0.")]
protected ProcessorNode(ScriptGraphGraph graph)
Parameters
Properties
InPorts
Declaration
public ReadOnlyCollection<InPort> InPorts { get; }
Property Value
IsEnabled
Declaration
public bool IsEnabled { get; set; }
Property Value
LatestExecutionTime
Gets the number of milliseconds it took to process this node the last time it was processed. Returns -1
if it hasn't been processed yet.
Declaration
public long LatestExecutionTime { get; }
Property Value
OutPorts
Declaration
public ReadOnlyCollection<OutPort> OutPorts { get; }
Property Value
Rng
Gets the instance of random used for processing this node.
Declaration
[Obsolete("Get the random object by calling Get<Rng>() instead. This property will be removed in version 2.0.")]
public Rng Rng { get; }
Property Value
Methods
AddIn(string, Type)
Adds an in port with the given name of the given type.
Declaration
protected InPort AddIn(string name, Type type)
Parameters
Type |
Name |
Description |
string |
name |
The port's name.
|
Type |
type |
The port's data type.
|
Returns
Type |
Description |
InPort |
The new in port.
|
AddIn<T>(string)
Adds an in port with the given name of the given type.
Declaration
protected InPort AddIn<T>(string name)
Parameters
Type |
Name |
Description |
string |
name |
The port's name.
|
Returns
Type |
Description |
InPort |
The new in port.
|
Type Parameters
AddOut(string, Type)
Adds an out port with the given name of the given type.
Declaration
protected OutPort AddOut(string name, Type type)
Parameters
Type |
Name |
Description |
string |
name |
The port's name.
|
Type |
type |
The port's data type.
|
Returns
Type |
Description |
OutPort |
The new out port.
|
AddOut<T>(string)
Adds an out port with the given name of the given type.
Declaration
protected OutPort AddOut<T>(string name)
Parameters
Type |
Name |
Description |
string |
name |
The port's name.
|
Returns
Type |
Description |
OutPort |
The new out port.
|
Type Parameters
ClearPorts()
Declaration
GetInPort(string)
Declaration
public InPort GetInPort(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
GetOutPort(string)
Declaration
public OutPort GetOutPort(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
HasInPort(string)
Declaration
public bool HasInPort(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
HasOutPort(string)
Returns whether the out port with the given name exists on the node.
Declaration
public bool HasOutPort(string name)
Parameters
Type |
Name |
Description |
string |
name |
The name.
|
Returns
Type |
Description |
bool |
True if the port exists, false otherwise.
|
Initialize()
Declaration
public override void Initialize()
Overrides
MoveIn(int, int)
Move the in port to a different index
Declaration
public void MoveIn(int oldIndex, int newIndex)
Parameters
Type |
Name |
Description |
int |
oldIndex |
The port's old index.
|
int |
newIndex |
The port's new index.
|
MoveOut(int, int)
Move the out port to a different index
Declaration
public void MoveOut(int oldIndex, int newIndex)
Parameters
Type |
Name |
Description |
int |
oldIndex |
The port's old index.
|
int |
newIndex |
The port's new index.
|
Declaration
public virtual void OnLoadInputPorts()
OnLoadOutputPorts()
Declaration
public virtual void OnLoadOutputPorts()
OnProcess()
Contains all the processing logic of this node. Called by Process.
Declaration
protected virtual void OnProcess()
OnProcessMainThread()
Contains all the processing logic of this node that must be executed on the main thread.
Called by Process after OnProcess
Declaration
protected virtual void OnProcessMainThread()
OnProcessMainThreadCoroutine()
Declaration
protected virtual IEnumerator OnProcessMainThreadCoroutine()
Returns
Process()
Declaration
RemoveIn(string)
Removes the in port with the given name from the node.
Declaration
public void RemoveIn(string name)
Parameters
Type |
Name |
Description |
string |
name |
The port's name.
|
RemoveOut(string)
Removes the out port with the given name from the node.
Declaration
public void RemoveOut(string name)
Parameters
Type |
Name |
Description |
string |
name |
The port's name.
|
RenameIn(string, string)
Declaration
public void RenameIn(string oldName, string newName)
Parameters
Type |
Name |
Description |
string |
oldName |
The port's old name.
|
string |
newName |
The port's new name.
|
RenameOut(string, string)
Declaration
public void RenameOut(string oldName, string newName)
Parameters
Type |
Name |
Description |
string |
oldName |
The port's old name.
|
string |
newName |
The port's new name.
|
Events
NodeProcessingCompleted
Declaration
public static event Action<ProcessorNode> NodeProcessingCompleted
Event Type
OnInPortAdded
Declaration
public event Action<InPort> OnInPortAdded
Event Type
OnInPortMoved
Declaration
public event Action<InPort, int> OnInPortMoved
Event Type
OnInPortRemoved
Declaration
public event Action<InPort> OnInPortRemoved
Event Type
OnInPortRenamed
Declaration
public event Action<InPort, string, string> OnInPortRenamed
Event Type
OnOutPortAdded
Declaration
public event Action<OutPort> OnOutPortAdded
Event Type
OnOutPortMoved
Declaration
public event Action<OutPort, int> OnOutPortMoved
Event Type
OnOutPortRemoved
Declaration
public event Action<OutPort> OnOutPortRemoved
Event Type
OnOutPortRenamed
Declaration
public event Action<OutPort, string, string> OnOutPortRenamed
Event Type
ProcessingCompleted
Event called whenever processing has been completed.
Declaration
[Obsolete("Please use the static event NodeProcessingCompleted instead.")]
public event Action ProcessingCompleted
Event Type
Implements