Back to API Reference
Class
TextCommandButton
sealed
Inherits:MonoBehaviour
Runs a TextCommand from the Button or Toggle on the same GameObject — a toolbar control. The control is interactable while the command applies to its field, a Toggle shows whether the command's effect is on at the selection (IsActive), and pressing it keeps the field focused.
Remarks
The field is
Target, or while that is empty, the field being edited (ActiveEditor); read-only selectable text needs an explicit target. The control refreshes when its field's selection, text or caret context changes, when the active editor changes, when UniText writes the clipboard and when the application regains focus, which is when another app can have changed the clipboard; the state a command produces reaches the control through those changes, after the field settles.public TextCommand Command{ get; set }Command the control runs; unassigned leaves the control disabled.
public UniTextSelectable Target{ get; set }Field the command acts on; empty follows the field being edited.
