Class NodeDefinition
Base class for all node definition declarations. Provides helper functionality and base implementations around NodeDefinition.
A NodeDefinition instance exists per existing NodeSet.
Inherited Members
Namespace: Unity.DataFlowGraph
Syntax
public abstract class NodeDefinition
Properties
HasStaticPortDescription
Returns whether this node type's input and output ports are always fixed (see GetStaticPortDescription()).
Declaration
public bool HasStaticPortDescription { get; }
Property Value
Type | Description |
---|---|
Boolean |
Set
The NodeSet associated with this instance of this node definition.
Declaration
protected NodeSet Set { get; }
Property Value
Type | Description |
---|---|
NodeSet |
Methods
Destroy(DestroyContext)
Destructor, provides an opportunity to clean up resources related to this instance. Destroy(NodeHandle)
Declaration
protected virtual void Destroy(DestroyContext ctx)
Parameters
Type | Name | Description |
---|---|---|
DestroyContext | ctx |
Remarks
It is undefined behaviour to throw an exception from this method.
Dispose()
Declaration
protected virtual void Dispose()
EmitMessage<T, TNodeDefinition>(NodeHandle, MessageOutput<TNodeDefinition, T>, T)
Emit a message from yourself on a port. Everything connected to it will receive your message.
Declaration
[Obsolete("Functionality moved to MessageContext/UpdateContext.EmitMessage")]
protected void EmitMessage<T, TNodeDefinition>(NodeHandle from, MessageOutput<TNodeDefinition, T> port, in T msg)
where TNodeDefinition : NodeDefinition
Parameters
Type | Name | Description |
---|---|---|
NodeHandle | from | |
MessageOutput<TNodeDefinition, T> | port | |
T | msg |
Type Parameters
Name | Description |
---|---|
T | |
TNodeDefinition |
GetPortDescription(NodeHandle)
Retrieve the runtime type information about the given node's input and output ports (see PortDescription.
Declaration
public PortDescription GetPortDescription(NodeHandle handle)
Parameters
Type | Name | Description |
---|---|---|
NodeHandle | handle |
Returns
Type | Description |
---|---|
PortDescription |
GetStaticPortDescription()
Retrieve the static type information about this node type's input and output ports (see PortDescription).
Declaration
public PortDescription GetStaticPortDescription()
Returns
Type | Description |
---|---|
PortDescription |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if this node type does not have a static port description (HasStaticPortDescription) |
Init(InitContext)
Constructor function, called for each instantiation of this type. Create<TDefinition>()
Declaration
protected virtual void Init(InitContext ctx)
Parameters
Type | Name | Description |
---|---|---|
InitContext | ctx | Provides initialization context and do-once operations for this particular node. Init(InitContext) |
Remarks
It is undefined behaviour to throw an exception from this method.
OnUpdate(UpdateContext)
Declaration
protected virtual void OnUpdate(in UpdateContext ctx)
Parameters
Type | Name | Description |
---|---|---|
UpdateContext | ctx |
Remarks
It is undefined behaviour to throw an exception from this method.