기술 자료

Unity Engine

Unity Engine

DebugStyles

Provides theme-aware visual resources for representing evaluation states when you debug a graph.
읽는 시간 1분최근 업데이트: 2달 전

Definition

public static class DebugStyles

Remarks

The colors adapt to the current Editor theme, so you don't have to track the theme yourself.
Don't rely on colors alone to communicate a debug state. DebugStyles.True and DebugStyles.False differ mainly in hue, so users with a color vision deficiency might not be able to tell them apart. Pair the color with a second visual cue, such as an icon (e.g. ConditionReference.Icon), a dash pattern (e.g. TransitionReference.IsDashed), a line width override (e.g. TransitionReference.WidthOverride) or an animation (e.g. GraphMotion.Play) so that the state remains readable without color.
A graph tool sets a debug color and icon on a transition element:

Examples

using var debugContext = Registry.CreateVisualizationContext(myStateMachine.ID);TransitionReference transitionRef = debugContext.GetTransitionReference(myTransition.ID);transitionRef.LineColor = DebugStyles.Pending;transitionRef.Icon = DebugStyles.PendingIcon;

Static Properties

Property

Description

FalseThe suggested color to represent a false or failing state during debug visualization.
FalseIconThe suggested icon to represent a false or failing state during debug visualization.
PendingThe suggested color to represent a pending or undetermined state during debug visualization.
PendingIconThe suggested icon to represent a pending or undetermined state during debug visualization.
TrueThe suggested color to represent a true or passing state during debug visualization.
TrueIconThe suggested icon to represent a true or passing state during debug visualization.