# Wire

> Represents a wire connection between an output port and an input port in a graph.

## Definition

* **Type:** Class
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.6/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor
* **Implements:** [IEquatable\<Wire>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public sealed class Wire : IEquatable<Wire>
```

## Remarks

A [Wire](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire.md) corresponds to the connection between two ports, including connections that pass through wire portals. Use [Graph.GetWire](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graph/getwire.md) to obtain a [Wire](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire.md) for a connected port pair.

Additional Resources: [Graph.GetWire](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graph/getwire.md), [IPort](/engine/6000.6/script-reference/unity/graphtoolkit/editor/iport.md)

Retrieve a wire between two connected ports and customize its visual properties on the graph canvas.

## Examples

```csharp
Wire wire = graph.GetWire(outputPort, inputPort);
wire.WidthOverride = 4f;
wire.Opacity = 0.5f;
wire.IsDashed = true;
```

## Properties

| Property                                                                                         | Description                                                                                                                          |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| [Graph](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/graph.md)                 | The [Wire.Graph](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/graph.md) that contains the current wire connection. |
| [InputPort](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/inputport.md)         | The input port at the end of the connection.                                                                                         |
| [IsDashed](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/isdashed.md)           | Whether the wire is drawn with a dashed pattern.                                                                                     |
| [Opacity](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/opacity.md)             | The opacity multiplier applied to the wire.                                                                                          |
| [OutputPort](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/outputport.md)       | The output port at the start of the connection.                                                                                      |
| [WidthOverride](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/widthoverride.md) | The width override applied to the wire.                                                                                              |

## Methods

| Method                                                                                       | Description                                                           |
| -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| [Equals](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/equals.md)           | Determines whether the current wire is equal to the specified object. |
| [GetHashCode](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/gethashcode.md) | Returns a hash code that represents the current wire.                 |

## Operators

| Operator                                                                                       | Description                                                  |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [operator ==](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/op-equality.md)   | Determine whether two wires represent the same connection.   |
| [operator !=](/engine/6000.6/script-reference/unity/graphtoolkit/editor/wire/op-inequality.md) | Determine whether two wires represent different connections. |
