Port
GraphView Port class.
Read time 10 minutesLast updated 9 days ago
Definition
- Type: Class
- Namespace: UnityEditor.Experimental.GraphView
- Assembly: UnityEditor
- Inherits from: GraphElement
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, ISelectable
public class Port : GraphElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, ISelectable
Properties
Property | Description |
|---|---|
| allowMultiDrag | When this property is set to true, you can select multiple edges connected to this port, and drag them all at the same time (for example, to disconnect them and reconnect them to another port). When this property is set to false, you can only drag one connected edge at a time. |
| capacity | Specify how many edges a port can have connected. |
| collapsed | Port's collapsed state. |
| connected | Port's connected state. |
| connections | All the port's current connections. |
| direction | Port's direction. |
| disabledPortColor | The color of the port when disabled. |
| edgeConnector | Reference to the edge connector. |
| highlight | Is the port highlighted. |
| node | Port's node. |
| orientation | Port's orientation. |
| portCapLit | Is the port cap lit or not. |
| portColor | The color of the port. |
| portName | Port name. |
| portType | Port type. |
| showInMiniMap | Whether the element is shown in the minimap. For Port, this property is always set to false. |
| source | Port's source. |
| visualClass | The name of the uss class to use to style the port. |
Methods
Method | Description |
|---|---|
| Connect | Connect and edge to the port. |
| ConnectTo | Creates an edge between this port and the 'other' port. |
| ContainsPoint | Check if point is on top of port. Used for selection and hover. |
| Disconnect | Disconnect edge from port. |
| DisconnectAll | Disconnect all edges from port. |
| GetGlobalCenter | Get the port's center. |
| HandleEventBubbleUp | Executes logic on this element during the BubbleUp phase, immediately before this element's BubbleUp callbacks. Calling StopPropagation will prevent further invocations of this method along the propagation path. |
| OnCustomStyleResolved | Called when the custom style properties are resolved. |
| OnStartEdgeDragging | Called when an edge is dragged. |
| OnStopEdgeDragging | Called when an edge dragging ends. |
Static Methods
Method | Description |
|---|---|
| Create | Factory method for creating a port. |
Enums
Enum | Description |
|---|---|
| Port.Capacity | Specify how many edges a port can have connected. |