Back to API Reference
Class
UniTextContextMenu
sealed
Inherits:MonoBehaviour
Text context menu you build yourself: lay out and style the panel, buttons, and toggles in the scene however you like, then list the ContextMenuItem bindings here — each maps one of your controls to a command. PrefabTextContextMenu drives it with the applicable capabilities, and standard commands route back to the presenter it passed. One menu is shareable across many fields — actions always reach the field that last showed it. The component only wires control events, shows / hides controls per applicability, positions the panel, and dismisses on an outside click — it draws nothing itself. Prefabs assigned to PrefabTextContextMenu use density-independent layout units.
Remarks
Visibility is driven through a
CanvasGroup, never by toggling the GameObject active: the panel stays active so a sibling FocusGuard keeps the editor focused while the user presses a control. Add the guard to this object to preserve focus during interaction.