AddItem
Adds an item to this menu using a default VisualElement.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
AddItem(string, bool, Action)
Adds an item to this menu using a default VisualElement.
public override void AddItem(string itemName, bool isChecked, Action action)
Parameters
AddItem(string, bool, Action<Object>, Object)
Adds an item to this menu using a default VisualElement.
public override void AddItem(string itemName, bool isChecked, Action<object> action, object data)
Parameters
The text to display to the user.
Indicates whether a checkmark next to the item is displayed.
The callback to invoke when the item is selected by the user.
The object to pass to the callback as a parameter.
Remarks
This overload of the method accepts an arbitrary object that's passed as a parameter to your callback.