Get RAPTOR

RaptorModelOption

An extra switch row in the Inspector's Model → Output group.

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

Constructors

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.

ParameterTypeDefaultDescription
idstringThe row's id. Used as Path by the registry and as other rows' after.
labelstringThe row's label.
getFunc<RaptorModel, bool>Reads the switch.
setAction<RaptorModel, bool, string>Writes the switch.
iconstringnullThe glyph name, or null for the default.
afterstringnullThe 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.

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