Node
Main GraphView node class.
Read time 10 minutesLast updated 5 days ago
Definition
- Type: Class
- Namespace: UnityEditor.Experimental.GraphView
- Assembly: UnityEditor
- Inherits from: GraphElement
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, ISelectable, ICollectibleElement
public class Node : GraphElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, ISelectable, ICollectibleElement
Constructors
Constructor | Description |
|---|---|
| Node() | Node's constructor. |
| Node(System.String) | Node's constructor. |
Properties
Property | Description |
|---|---|
| expanded | Is node expanded. |
| extensionContainer | Empty container used to display custom elements. After adding elements, call RefreshExpandedState in order to toggle this container visibility. |
| inputContainer | Input container used for input ports. |
| mainContainer | Main container that includes all other containers. |
| outputContainer | Outputs container, used for output ports. |
| title | Node's title element. |
| titleButtonContainer | Title bar button container. Contains the top right buttons. |
| titleContainer | Title bar container. |
| topContainer | Entire top area containing input and output containers. |
Methods
Method | Description |
|---|---|
| BuildContextualMenu | Add menu items to the node contextual menu. |
| CollectElements | Retrieves the set of edges that match a specified condition. The tested edges are connected to this node. |
| InstantiatePort | Create a new port specific to this node. |
| OnPortRemoved | Called when port is remove. |
| RefreshExpandedState | After adding custom elements to the extensionContainer, call this method in order for them to become visible. |
| RefreshPorts | Refresh the layout of the ports. |
| SetPosition | Set node position. |
| ToggleCollapse | Toggle node's collapse state. |
| UseDefaultStyling | Applies the default styling of Node. This must be explicitly called by Node subclasses that use their own uxml files. |