Back to API Reference
Class
TextContextMenu
abstract
Inherits:MonoBehaviour
Context menu a field presents in Unity UI, from a prefab: its own (ContextMenuPrefab) or the project's (ContextMenuPrefab). UniTextContextMenu is the menu laid out from Unity UI objects; derive from this class for a menu of your own — radial, animated, anything.
Remarks
The field instantiates the prefab once per play session under the shared touch overlay, a screen-space canvas above every other measured in density-independent units, and every field presenting the same prefab shares that instance. The field calls
Show each time the menu opens, whenever its entries change, and again to re-anchor a menu touch opened over a selection that moved; every call arrives on the main thread. Trigger tells the menu what opened it.Derived Types(1)
Types that inherit from TextContextMenu.
Shows entries at placement and records invoke as the single receiver of invoked entries until the next Show replaces it or Hide clears it — a menu shared across fields always reports to the field that showed it last. A disabled entry (IsEnabled) shows disabled or not at all and is never invoked; a menu left with nothing to show hides.
