TextCommand
A command of the text context menu: its label, when it applies, and what it does to the field that presents it. The field lists its commands in Commands; the system menu shows the applicable ones in that order, and the Unity-UI menu shows each on the item bound to it. Derive from it and implement Execute for a command of your own.
Remarks
Derived Types(11)
Types that inherit from TextCommand.
Label of the command's menu entry in the current language: the title set in the inspector, or DefaultTitle while none is set or a localized one is still loading.
Whether invoking the command leaves the menu up, presented again over the selection the command leaves, as select-all does on the touch platforms. False by default: a command takes the menu down, and on Android a touch menu's selection with it, collapsed at its focus as Android's text view leaves it.
Creates a command that shows its DefaultTitle.
public virtual bool IsApplicable(in TextCommandContext context)Whether the command applies to the field's current state. A menu hides or disables a command that does not apply, and a command runs only while it applies.
public virtual bool IsActive(in TextCommandContext context)Whether the command's effect is on at the field's selection, for a control that shows it as pressed — a style toggle reports whether its style is active. False for a command that toggles nothing.
public abstract void Execute(in TextCommandContext context)Runs the command against the field's current state, to which it applies (IsApplicable).
public virtual bool Matches(TextCommand command)Whether command is this command, as a menu item bound to this command matches the field's (ContextMenuItem.Command): by default, a command of this type or one derived from it. The title plays no part; a command whose settings decide its effect compares them too, as a style toggle compares its style.
