Class ContextNode
A specialized node that serves as a dynamic container for compatible BlockNode instances.
Implements
Inherited Members
Namespace: Unity.GraphToolkit.Editor
Assembly: Unity.GraphToolkit.Editor.dll
Syntax
[Serializable]
public abstract class ContextNode : Node, INode
Remarks
Context nodes are node structures that group and control a sequence of BlockNode instances.
A ContextNode owns a list of BlockNodes. These blocks cannot exist independently
in the graph and must always be children of a context node.
To control which block node types are valid for a specific context node type, use the
UseWithContextAttribute on the corresponding BlockNode class.
Properties
blockCount
The number of BlockNodes contained in this context node.
Declaration
public int blockCount { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
The block count reflects the number of block nodes currently managed by the context node. This value may change dynamically as blocks are added or removed.
blockNodes
An IEnumerable
collection of the BlockNodes contained in this context node.
Declaration
public IEnumerable<BlockNode> blockNodes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<BlockNode> |
Remarks
The returned collection reflects the current order and content of the context's block list.
Methods
GetBlock(int)
Retrieves the BlockNode at the specified index in the context node's block list.
Declaration
public BlockNode GetBlock(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The zero-based index of the block to retrieve. |
Returns
Type | Description |
---|---|
BlockNode | The BlockNode at the specified index. |
Remarks
The index is zero-based and corresponds to the block’s position within blockNodes.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if the |