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
- Type: Struct
- Namespace: Unity.GraphToolkit.Editor.GraphVisualization
- Assembly: UnityEditor
- Implements: IEquatable<TransitionReference>
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.
Additional Resources: TransitionReference.Context, Context.GetTransitionReference
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 |
|---|---|
| Context | Visualization context that produced the current transition reference. |
| FillColor | The color the referenced transition's arrow is filled with, or |
| Icon | The icon override applied in the transition inspector for the referenced transition, or |
| 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 |
| 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. |
Methods
Method | Description |
|---|---|
| ClearCustomization | Clears all customization previously applied to the referenced transition. |
| Equals | Indicates whether the current TransitionReference is equal to another object. |
| GetHashCode | Returns a hash code for the current TransitionReference. |
Operators
Operator | Description |
|---|---|
| operator == | Compares two TransitionReference values for equality. |
| operator != | Compares two TransitionReference values for inequality. |