Unity 6.3
0 онлайн 90 гостей 3 в системе
Вход

EditorToolContext.PopulateMenu

Declaration

public void PopulateMenu(UIElements.DropdownMenu menu);

Параметры

Параметр Описание
меню Контекстное меню представления Scene, в которое добавляются пункты меню.

Описание

Добавление пунктов меню в контекстное меню представления Scene.

См. MenuUtility для полезных функций, которые добавляют пункты меню в контекстное меню представления Scene.

public override void PopulateMenu(DropdownMenu menu)
{
    // Add all clipboard operations to the context menu (Cut, Copy, Paste, Delete, and Duplicate).
    ContextMenuUtility.AddClipboardEntriesTo(menu);

    // Add an item to the context menu using a delegate or an EditorAction.
    menu.AppendAction("Parent Item/Child Item", (item) => Debug.Log("Executed Child Item."));

    // Add an item to the context menu using a predefined MenuItem.
    ContextMenuUtility.AddMenuItem(menu, "GameObject/Move To View");
}