struct in Unity.GraphToolkit.Editor.GraphVisualization
Identifies a state inside a visualization StateReference.Context so visualization changes can be applied to it.
Obtain a StateReference from Context.GetStateReference. The reference is only meaningful for the StateReference.Context that produced it.
You can use its properties to set, retrieve, or clear customization for that specific state in the state machine canvas.
Two StateReference values are equal when they share the same StateReference.StateID and refer to the same StateReference.Context instance.
Additional resources: StateReference.Context, Context.GetStateReference
// Obtain a reference to a state by its ID, then drive its visual state. using Context context = Registry.CreateVisualizationContext(stateMachineID); StateReference stateRef = context.GetStateReference(stateID);
// Show a half-filled accent bar on the state. stateRef.FillAmount = 50f;
// Replace the static fill with a looping progress animation. context.Motion.Play(stateRef, animationSpeed: 1f);
// Stop the animation. The bar remains visible at the previously set fill amount. context.Motion.Stop(stateRef);
| Property | Description |
|---|---|
| Context | Visualization context that produced the current state reference. |
| FillAmount | The progress fill amount displayed on the referenced state's accent bar, expressed as a percentage. |
| StateID | Unique identifier of the state this reference points to. |
| Method | Description |
|---|---|
| ClearCustomization | Clears all customization previously applied to the referenced state, removes any fill amount, and stops any looping animation. |
| Equals | Indicates whether the current StateReference is equal to another StateReference. |
| GetHashCode | Returns a hash code for the current StateReference. |
| Operator | Description |
|---|---|
| operator != | Compares two StateReference values for inequality. |
| operator == | Compares two StateReference values for equality. |