Get RAPTOR

RaptorSuiteControls.Menu

A grouped Suite menu built on RaptorSuiteMenu.Builder, with a header per group and separators between groups.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

A grouped Suite menu built on RaptorSuiteMenu.Builder. Each group has a header naming what its rows act on, and groups are divided by separators. The current row is shown in blue with a tick.

public sealed class Menu

Constructors

public Menu()

Creates an empty menu.

Methods

ChoiceItem

public Menu ChoiceItem(string iconGlyph, string label, System.Action action, bool isCurrent, bool enabled = true, string shortcut = null)

Adds a row to a single-choice group. The chosen row is shown in blue with a tick.

ParameterTypeDefaultDescription
iconGlyphstringThe icon name.
labelstringThe row label.
actionSystem.ActionThe action the row runs.
isCurrentboolWhether this row is the chosen option.
enabledbooltrueWhether the row is enabled. A disabled row is dimmed and ignores clicks.
shortcutstringnullThe hotkey text, or null.

Returns: This menu.

public Menu Header(string label)

Adds a group heading.

ParameterTypeDescription
labelstringThe heading text.

Returns: This menu.

Item

public Menu Item(string iconGlyph, string label, System.Action action, bool isChecked = false, bool enabled = true, string shortcut = null)

Adds a row.

ParameterTypeDefaultDescription
iconGlyphstringThe icon name.
labelstringThe row label.
actionSystem.ActionThe action the row runs.
isCheckedboolfalseWhether the row shows a tick.
enabledbooltrueWhether the row is enabled. A disabled row is dimmed and ignores clicks.
shortcutstringnullThe hotkey text, or null.

Returns: This menu.

Separator

public Menu Separator()

Adds a separator.

Returns: This menu.

StateItem

public Menu StateItem(string iconGlyph, string label, System.Action action, string state, bool isChecked = false, bool enabled = true)

Adds a row with a muted state label on the right, such as Docked, Tab or Open.

ParameterTypeDefaultDescription
iconGlyphstringThe icon name.
labelstringThe row label.
actionSystem.ActionThe action the row runs.
statestringThe state label.
isCheckedboolfalseWhether the row shows a tick.
enabledbooltrueWhether the row is enabled. A disabled row is dimmed and ignores clicks.

Returns: This menu.

SwatchItem

public Menu SwatchItem(UnityEngine.Color swatch, string label, System.Action action, bool isCurrent = false)

Adds a row with a 24 x 14 colour swatch before its label.

ParameterTypeDefaultDescription
swatchUnityEngine.ColorThe swatch colour.
labelstringThe row label.
actionSystem.ActionThe action the row runs.
isCurrentboolfalseWhether this row is current. A current row is shown in blue with a tick.

Returns: This menu.

  • RaptorSuiteControls: Suite-style controls for tools in other assemblies, such as RAPTOR Render's Ray-traced preview settings.
  • RaptorSuiteMenu: The menu used by every RAPTOR dropdown, with icon and label rows, ticks, hotkeys and section headers.