Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TransitionReference

Identifies a transition inside a visualization TransitionReference.Context so visualization changes can be applied to it.
Read time 2 minutesLast updated 10 days ago

Definition

public readonly struct TransitionReference : IEquatable<TransitionReference>

Remarks

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.

Examples

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

ContextVisualization context that produced the current transition reference.
FillColorThe color the referenced transition's arrow is filled with, or
null
when no fill color override is applied.
IconThe icon override applied in the transition inspector for the referenced transition, or
null
when no icon override is applied.
IsDashedWhether the referenced transition is drawn with a dashed pattern.
LineColorThe color the referenced transition's wire and arrow border is drawn with, or
null
when no line color override is applied.
OpacityThe opacity multiplier applied to the referenced transition.
TransitionIDUnique identifier of the transition this reference points to.
WidthOverrideThe line width override applied to the referenced transition.

Methods

Method

Description

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

Operators

Operator

Description

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