RaptorSuiteControls.Menu
A grouped Suite menu built on RaptorSuiteMenu.Builder, with a header per group and separators between groups.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, 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 MenuConstructors
Menu
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.
| Parameter | Type | Default | Description |
|---|---|---|---|
iconGlyph | string | The icon name. | |
label | string | The row label. | |
action | System.Action | The action the row runs. | |
isCurrent | bool | Whether this row is the chosen option. | |
enabled | bool | true | Whether the row is enabled. A disabled row is dimmed and ignores clicks. |
shortcut | string | null | The hotkey text, or null. |
Returns: This menu.
Header
public Menu Header(string label)Adds a group heading.
| Parameter | Type | Description |
|---|---|---|
label | string | The 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
iconGlyph | string | The icon name. | |
label | string | The row label. | |
action | System.Action | The action the row runs. | |
isChecked | bool | false | Whether the row shows a tick. |
enabled | bool | true | Whether the row is enabled. A disabled row is dimmed and ignores clicks. |
shortcut | string | null | The 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
iconGlyph | string | The icon name. | |
label | string | The row label. | |
action | System.Action | The action the row runs. | |
state | string | The state label. | |
isChecked | bool | false | Whether the row shows a tick. |
enabled | bool | true | Whether 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
swatch | UnityEngine.Color | The swatch colour. | |
label | string | The row label. | |
action | System.Action | The action the row runs. | |
isCurrent | bool | false | Whether this row is current. A current row is shown in blue with a tick. |
Returns: This menu.
Related types
- 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.