RaptorModelOptions
The registry of extra Model → Output rows.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
The core rows are Collider, Merge faces, Optimise mesh and Single mesh. A module registers extra rows here, and the Inspector shows each one at the position it requests. Each field path can have one row. The first registration wins and later ones return false, so a registrant can safely run twice. Core paths cannot be registered. Register from an [InitializeOnLoad] class. The registry is editor-only and is cleared on domain reload, after which the registrants run again.
public static class RaptorModelOptionsFields
DefaultIcon
public const string DefaultIcon;The glyph used for a row registered without an icon.
Properties
All
public static IReadOnlyList<RaptorModelOption> All { get; }A snapshot of every registered row, in registration order.
Count
public static int Count { get; }The number of rows.
Version
public static int Version { get; }Increments on every change.
Methods
IsRegistered
public static bool IsRegistered(string path)Whether a row with this path is registered.
| Parameter | Type | Description |
|---|---|---|
path | string | The row's path, slash-separated. |
Returns: True when registered.
Register
public static bool Register(RaptorModelOption option)Adds a row. Returns false and keeps the existing row when the path is already registered or belongs to a core Model row. Throws ArgumentException when the path is not a serialized bool, int, float or enum field of RaptorModel.
| Parameter | Type | Description |
|---|---|---|
option | RaptorModelOption | The row. |
Returns: False when the path is taken.
Call from an [InitializeOnLoad] static constructor on the main thread.
Register
public static bool Register(string path, string label, string icon = null, string after = null)Shorthand for Register with a new RaptorModelOption.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | string | The row's path, slash-separated. | |
label | string | The row's label. | |
icon | string | null | The glyph name, or null for the default. |
after | string | null | The row to follow, or null to place it at the end. |
Returns: False when the path is taken.
Call from an [InitializeOnLoad] static constructor on the main thread.
TryGet
public static bool TryGet(string path, out RaptorModelOption option)Gets the row with this path.
| Parameter | Type | Description |
|---|---|---|
path | string | The row's path, slash-separated. |
option | out RaptorModelOption | The row. |
Returns: False when no row has this path.
Related types
- RaptorModelOption: An extra switch row in the Inspector's Model → Output group.