Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

TransitionReference

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 transition inside a visualization TransitionReference.Context so visualization changes can be applied to it.

Obtain a TransitionReference from Context.GetTransitionReference, providing the unique identifier of the transition. The reference is only meaningful for the TransitionReference.Context that produced it. You can use its properties to set, retrieve, or clear customization for that specific transition in the state machine canvas. Two TransitionReference values are equal when they share the same TransitionReference.TransitionID and refer to the same TransitionReference.Context instance.

Additional resources: TransitionReference.Context, Context.GetTransitionReference

 using var debugContext = Registry.CreateVisualizationContext(myStateMachine.ID);
 ITransition startTransition = myStateMachine.GetTransitions(startState, nextState).First();

TransitionReference startTransitionRef = debugContext.GetTransitionReference(startTransition.ID); startTransitionRef.LineColor = DebugStyles.Pending; debugContext.Motion.Play(startTransitionRef);

Properties

Property Description
Context Visualization context that produced the current transition reference.
FillColor The color the referenced transition's arrow is filled with, or null when no fill color override is applied.
Icon The icon override applied in the transition inspector for the referenced transition, or null when no icon override is applied.
IsDashed Whether the referenced transition is drawn with a dashed pattern.
LineColor The color the referenced transition's wire and arrow border is drawn with, or null when no line color override is applied.
Opacity The opacity multiplier applied to the referenced transition.
TransitionID Unique identifier of the transition this reference points to.
WidthOverride The line width override applied to the referenced transition.

Public Methods

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

Operators

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