Back to API Reference
Class
FieldDecorator
abstract
Inherits:InputBehavior
Base class for state-driven field visuals: placeholder, floating label, supporting text, character counter, or validation feedback. It participates in the ordinary InputBehavior lifecycle and appears in the editor's behavior type picker.
Derived Types(4)
Types that inherit from FieldDecorator.
CCCC
CharacterCounterDecorator
Shows the current length — count, or count/limit when a LengthLimitBehavior publishes a cap — counting in the cap's TextLengthUnit (grapheme clusters when there is no cap), and recolors once the count reaches the limit. Counts the document SOURCE — the same space LengthLimitBehavior enforces in, so count and cap always agree; in a field with hidden markup the count therefore includes the markup characters, not just the visible text.
FloatingLabelDecorator
Animates a label between its resting position (inside the field) and a floated position (typically the top edge), scaling it down on the way; the label stays visible throughout. For a different motion model — a tween library, a path — write your own FieldDecorator.
PlaceholderDecorator
Shows target text while the field is empty, keeping its GameObject active.
SupportingTextDecorator
Drives a text target with helper text, replacing it with the validation message and an error color while the field is invalid. The supporting-text slot of a form field.
Starts per-frame OnTick delivery. Idempotent; idle decorators receive no ticks.
Cache target references and capture any original state to restore in OnDetach.
protected abstract void OnFieldState(in FieldState state)Called whenever focus, text, composition, or validation changes. Drive visuals from state.
Per-frame hook delivered only between RequestTick and StopTick. deltaTime is unscaled.
