Class ContextualMenuManager
Use this class to display a contextual menu.
Namespace: UnityEngine.UIElements
Syntax
public abstract class ContextualMenuManager : object
Methods
DisplayMenu(EventBase, IEventHandler)
Displays the contextual menu.
Declaration
public void DisplayMenu(EventBase triggerEvent, IEventHandler target)
Parameters
Type | Name | Description |
---|---|---|
EventBase | triggerEvent | The event that triggered the display of the menu. |
IEventHandler | target | The element for which the menu is displayed. |
DisplayMenuIfEventMatches(EventBase, IEventHandler)
Checks if the event triggers the display of the contextual menu. This method also displays the menu.
Declaration
public abstract void DisplayMenuIfEventMatches(EventBase evt, IEventHandler eventHandler)
Parameters
Type | Name | Description |
---|---|---|
EventBase | evt | The event to inspect. |
IEventHandler | eventHandler | The element for which the menu is displayed. |
Remarks
This is an abstract method. Each concrete implementation of the ContextualMenuManager defines the events that will display the menu.
DoDisplayMenu(DropdownMenu, EventBase)
Displays the contextual menu.
Declaration
protected abstract void DoDisplayMenu(DropdownMenu menu, EventBase triggerEvent)
Parameters
Type | Name | Description |
---|---|---|
DropdownMenu | menu | The menu to display. |
EventBase | triggerEvent | The event that triggers the display of the contextual menu. |