Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

WireReference

struct in Unity.GraphToolkit.Editor.GraphVisualization

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Identifies a wire inside a visualization WireReference.Context so visualization changes can be applied to it.

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.

Additional resources: WireReference.Context, Context.GetWireReference

Create a visualization context for a graph, retrieve a <see cref="Unity.GraphToolkit.Editor.GraphVisualization.WireReference" /> for a connected pair of ports, apply customizations, then clear them.

 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
Context Visualization context that produced the current wire reference.
InputPortID Unique identifier of the input port at the end of the connection.
IsDashed Whether the reference wire is drawn with a dashed pattern.
Opacity The opacity multiplier applied to the referenced wire.
OutputPortID Unique identifier of the output port at the start of the connection.
WidthOverride The width override applied to the referenced wire.

Public Methods

Method Description
ClearCustomization Clears all customization previously applied to the referenced wire.
Equals Indicates whether the current WireReference is equal to another WireReference.
GetHashCode Returns a hash code for the current WireReference.

Operators

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