Get RAPTOR

RaptorModelOptions

The registry of extra Model → Output rows.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, 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 RaptorModelOptions

Fields

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.

ParameterTypeDescription
pathstringThe 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.

ParameterTypeDescription
optionRaptorModelOptionThe 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.

ParameterTypeDefaultDescription
pathstringThe row's path, slash-separated.
labelstringThe row's label.
iconstringnullThe glyph name, or null for the default.
afterstringnullThe 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.

ParameterTypeDescription
pathstringThe row's path, slash-separated.
optionout RaptorModelOptionThe row.

Returns: False when no row has this path.