Back to API Reference
Class

DefaultTextHighlighter

Default highlighting logic — click flash with fade-out, hover tint, programmatic selection — wired to the built-in renderers (CanvasHighlightRenderer for UniText, WorldHighlightRenderer for UniTextWorld). Subclass and override either CreateHighlightRenderer or CreateHighlightRenderer to plug a custom visual on the chosen backend while keeping this logic.

public Color ClickColor{ get; set }

Gets or sets the click highlight color.

public float FadeDuration{ get; set }

Gets or sets the fade duration in seconds.

public Color HoverColor{ get; set }

Gets or sets the hover highlight color.

public Color SelectionColor{ get; set }

Gets or sets the selection highlight color.

protected override TextHighlightRenderer CreateHighlightRenderer()
protected override TextHighlightRenderer CreateHighlightRenderer()
public override void OnRangeClicked()
public override void OnRangeEntered()
public override void OnRangeExited()
public void SetSelection(int startCluster, int endCluster)

Sets the selection highlight to cover the specified text range. Use SelectionColor to control the color (and animate it externally).

public void ClearSelection()

Clears the selection highlight.

public override void Update()
public override void Destroy()