Scripting API

DropdownMenuAction

class in UnityEngine.UIElements · UnityEngine.UIElementsModule · inherits from DropdownMenuItem

9 of 9 of Unity's membersUnity's documentation
In Tassix

A menu item that runs an action; its status (from a callback) says whether it shows, is enabled or checked.

Constructors 1

DropdownMenuAction(string actionName, Action<DropdownMenuAction>? actionCallback, Func<DropdownMenuAction, Status>? actionStatusCallback, object? userData = null)

Properties 4

DropdownMenuEventInfo? eventInfo { get; }
string name { get; }
Status status { get; }

None until the menu is prepared for display (then what the callback says).

object? userData { get; }

Methods 4

static Status AlwaysDisabled(DropdownMenuAction a)
static Status AlwaysEnabled(DropdownMenuAction a)
void Execute()

Runs the action (whatever its status, as Unity's does).

void UpdateActionStatus(DropdownMenuEventInfo? eventInfo)