Back to API Reference
Class

InteractiveModifier

abstract

Base class for modifiers that create interactive (clickable/hoverable) text ranges.

Remarks

Inherit from this class to create custom interactive modifiers like links, hashtags, mentions, or any other clickable text elements. This class automatically: Registers/unregisters with InteractiveRangeRegistry Stores ranges in a PooledArrayAttribute<T> Delegates click/hover events to subclass implementations

Example

csharp
public TextHighlighter Highlighter{ get; set }

Gets or sets the per-modifier text highlighter. When null, the global UniText highlighter is used as fallback.

public string RangeType{ get }

Gets the type identifier for ranges created by this modifier.

public int Priority{ get }

Gets the priority for overlap resolution. Higher values win.

protected string AttributeKey{ get }
protected override void OnEnable()
protected override void OnDisable()
protected override void OnDestroy()
protected void AddRange(int start, int end, string data)

Adds an interactive range for the specified text region.

public bool TryGetRange()
protected virtual void HandleRangeClicked(InteractiveRange range, TextHitResult hit)

Called when the user clicks on a range owned by this modifier.

protected virtual void HandleRangeEntered(InteractiveRange range, TextHitResult hit)

Called when the pointer enters a range owned by this modifier (desktop only).

protected virtual void HandleRangeExited(InteractiveRange range)

Called when the pointer exits a range owned by this modifier (desktop only).

See Also