Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AppendAction

Appends an entry to the contextual menu.
Read time 1 minuteLast updated 6 days ago

Definition

AppendAction(string, Action)

Appends an entry to the contextual menu.
public void AppendAction(string actionName, Action action)

Parameters

actionName

The label of the entry. Use forward slashes to nest the entry under submenus.

action

The callback invoked when the user selects the entry.

AppendAction(string, Action<DropdownMenuAction>)

Appends an entry to the contextual menu.
public void AppendAction(string actionName, Action<DropdownMenuAction> action)

Parameters

actionName

The label of the entry. Use forward slashes to nest the entry under submenus.

The callback invoked when the user selects the entry. The argument gives access to the user data set on the entry.

AppendAction(string, Action<DropdownMenuAction>, Func<DropdownMenuAction, Status>, Object)

Appends an entry to the contextual menu, with a status callback that decides whether the entry is enabled, disabled, or checked when the menu opens.
public void AppendAction(string actionName, Action<DropdownMenuAction> action, Func<DropdownMenuAction, DropdownMenuAction.Status> actionStatusCallback, object userData = null)

Parameters

actionName

The label of the entry. Use forward slashes to nest the entry under submenus.

The callback invoked when the user selects the entry.

Callback that returns the entry's status at menu-open time.

userData

Arbitrary data forwarded to
action
and
actionStatusCallback
via _userData.