Class INodeExtensions
Provides extension methods related to nodes and ports in a graph.
Inherited Members
Namespace: Unity.GraphToolkit.Editor
Assembly: Unity.GraphToolkit.Editor.dll
Syntax
public static class INodeExtensions
Remarks
This static class defines utility methods that simplify interactions between graph components, such as retrieving the INode associated with a given IPort.
Methods
GetNode(IPort)
Retrieves the INode that owns the specified port.
Declaration
public static INode GetNode(this IPort port)
Parameters
Type | Name | Description |
---|---|---|
IPort | port | The port to get the owning node from. |
Returns
Type | Description |
---|---|
INode | The INode that contains the specified port. |
Remarks
This is helpful when analyzing graph structures, especially when traversing connections. The returned node provides context for the port’s role in the graph.
Examples
IPort port = somePortReference;
INode node = port.GetNode();
Debug.Log($"Port '{port.name}' belongs to node: {node}.");