Back to API Reference
Class

Style

sealed

Serializable container that links a modifier with its parse rule. Tracks registration state and ownership to prevent bugs.

Remarks

Note: "Initialized" state (buffers created, events subscribed) is tracked by BaseModifier.IsInitialized and happens lazily on first Apply(). Ownership rules: - Style tracks its owner UniText - Registration fails if already registered to different owner - State resets on deserialization
public BaseModifier Modifier{ get; set }

Gets or sets the modifier, with proper lifecycle management on hot-swap.

public IParseRule Rule{ get; set }

Gets or sets the parse rule, with proper lifecycle management on hot-swap.

public UniTextBase Owner{ get }

Gets the UniTextBase that owns this Style.

public bool IsValid{ get }

Returns true if the style is ready for registration. Requires a rule; modifier is required unless IsStandalone is true.

public bool IsRegistered{ get }

Returns true if registered to a UniText.

public static Style WholeText(BaseModifier modifier, string parameter)

Builds a style that applies modifier to the entire text via a whole-text RangeRule.

public static Style Range(BaseModifier modifier, int start, int end, string parameter)

Builds a style that applies modifier to a fixed codepoint range via a RangeRule.

public static Style Tag(BaseModifier modifier, string tagName, string defaultParameter)

Builds a style that activates modifier on ranges matched by a rich-text tag <tagName>...</tagName>.

See Also

BaseModifierIParseRuleAttributeParser