Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

ContextualMenu

class in UnityEngine.Experimental.UIElements

/

Implemented in:UnityEngine.UIElementsModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A contextual menu.

Constructors

ContextualMenuConstructor.

Public Methods

AppendActionAdd an item that will execute an action in the contextual menu. The item is added at the end of the current item list.
AppendSeparatorAdd a separator line in the menu. The separator is added at the end of the current item list.
InsertActionAdd an item that will execute an action in the contextual menu. The item is added at the end of the specified index in the list.
InsertSeparatorAdd a separator line in the menu. The separator is added at the end of the specified index in the list.
MenuItemsGet the list of menu items.
PrepareForDisplayUpdate the status of all items by calling their status callback and remove the separators in excess. This is called just before displaying the menu.
RemoveItemAtRemove the menu item at index.
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答