Back to API Reference
Class

ContextMenuItem

abstract

One entry of a UniTextContextMenu: the binding between a control you built in the scene (a Button, Toggle, …) and an action. The menu wires the control's event, and shows or hides the control per IsApplicable. Items carry no visuals — the control's look, layout, label, and icon are entirely yours. An item whose control is not assigned never counts as applicable, so an unwired menu cannot open as an invisible input-blocking panel.

Derived Types(2)

Types that inherit from ContextMenuItem.

public bool HasControl{ get }

Whether a scene control is assigned. Unassigned items are treated as not applicable.

public abstract bool IsApplicable()

Whether the item applies to the presented state. Non-applicable controls are hidden.

public abstract void Wire()

Hooks the bound control's event to this item's action. Called once by the menu.

public abstract void SetVisible()

Shows or hides the bound control for the current request.