Wire
Represents a wire connection between an output port and an input port in a graph.
Read time 1 minuteLast updated 8 days ago
Definition
- Type: Class
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
- Implements: IEquatable<Wire>
public sealed class Wire : IEquatable<Wire>
Remarks
A Wire corresponds to the connection between two ports, including connections that pass through wire portals. Use Graph.GetWire to obtain a Wire for a connected port pair.
Additional Resources: Graph.GetWire, IPort
Retrieve a wire between two connected ports and customize its visual properties on the graph canvas.
Examples
Wire wire = graph.GetWire(outputPort, inputPort);wire.WidthOverride = 4f;wire.Opacity = 0.5f;wire.IsDashed = true;
Properties
Property | Description |
|---|---|
| Graph | The Wire.Graph that contains the current wire connection. |
| InputPort | The input port at the end of the connection. |
| IsDashed | Whether the wire is drawn with a dashed pattern. |
| Opacity | The opacity multiplier applied to the wire. |
| OutputPort | The output port at the start of the connection. |
| WidthOverride | The width override applied to the wire. |
Methods
Method | Description |
|---|---|
| Equals | Determines whether the current wire is equal to the specified object. |
| GetHashCode | Returns a hash code that represents the current wire. |
Operators
Operator | Description |
|---|---|
| operator == | Determine whether two wires represent the same connection. |
| operator != | Determine whether two wires represent different connections. |