Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


WireReference

Identifies a wire inside a visualization WireReference.Context so visualization changes can be applied to it.
Read time 2 minutesLast updated 6 days ago

Definition

public readonly struct WireReference : IEquatable<WireReference>

Remarks

Obtain a WireReference from Context.GetWireReference, providing the unique identifiers of the output and input ports that define the connection. The reference is only meaningful for the WireReference.Context that produced it. You can use its properties to set, retrieve, or clear customization for that specific wire in the graph canvas. Two WireReference values are equal when they share the same WireReference.OutputPortID and WireReference.InputPortID, and refer to the same WireReference.Context instance.
Create a visualization context for a graph, retrieve a WireReference for a connected pair of ports, apply customizations, then clear them.

Examples

using Context context = Registry.CreateVisualizationContext(graph.UID);WireReference wire = context.GetWireReference(outputPortID, inputPortID);wire.IsDashed = true;wire.WidthOverride = 4f;wire.Opacity = 0.5f;wire.ClearCustomization();

Properties

Property

Description

ContextVisualization context that produced the current wire reference.
InputPortIDUnique identifier of the input port at the end of the connection.
IsDashedWhether the reference wire is drawn with a dashed pattern.
OpacityThe opacity multiplier applied to the referenced wire.
OutputPortIDUnique identifier of the output port at the start of the connection.
WidthOverrideThe width override applied to the referenced wire.

Methods

Method

Description

ClearCustomizationClears all customization previously applied to the referenced wire.
EqualsIndicates whether the current WireReference is equal to another object.
GetHashCodeReturns a hash code for the current WireReference.

Operators

Operator

Description

operator ==Compares two WireReference values for equality.
operator !=Compares two WireReference values for inequality.