RaptorModelOption
An extra switch row in the Inspector's Model → Output group.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
The row edits one serialized field of RaptorModel, or any other value through delegates. Each change is one undo step, named "Edit" followed by the label, and rebuilds the model.
public sealed class RaptorModelOptionConstructors
RaptorModelOption
public RaptorModelOption(string id, string label, Func<RaptorModel, bool> get, Action<RaptorModel, bool, string> set, string icon = null, string after = null) : this(id, label, icon, after)Creates a switch row bound to delegates, for a value stored outside RaptorModel.
| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | The row's id. Used as Path by the registry and as other rows' after. | |
label | string | The row's label. | |
get | Func<RaptorModel, bool> | Reads the switch. | |
set | Action<RaptorModel, bool, string> | Writes the switch. | |
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. |
RaptorModelOption
public RaptorModelOption(string path, string label, string icon = null, string after = null)Creates a switch row bound to a field of RaptorModel.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | string | The serialized field's name. | |
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. |
Properties
After
public string After { get; }The row this one follows, either a core Output path such as "singleMeshBake" or another registered path. When this is null or names a row that is not shown, the row goes at the end of the group.
Get
public Func<RaptorModel, bool> Get { get; }Reads the switch for one model. Null on a row bound to a field path.
Icon
public string Icon { get; }The row's glyph name. Null uses RaptorModelOptions.DefaultIcon.
IsBound
public bool IsBound { get; }Whether the row reads and writes through Get and Set instead of a field path.
Label
public string Label { get; }The row's label. Keep it to one or two words.
Path
public string Path { get; }The name of the RaptorModel field the row edits, which must be a top-level serialized bool, int, float or enum field. On a bound row (IsBound), this is the row's id and need not name a field.
Set
public Action<RaptorModel, bool, string> Set { get; }Writes the switch for one model. The third argument is the undo name. Runs inside the row's undo step, after the model has been recorded. Record any other objects you change under that name. Null on a row bound to a field path.
Related types
- RaptorModelOptions: The registry of extra Model → Output rows.