Get RAPTOR

RaptorSuiteTopBarSlots

Adds controls to the right side of the RAPTOR top bar, left of the Display field.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

Slots draw from right to left. The class works like RaptorSuitePaneHeaderSlots.

public static class RaptorSuiteTopBarSlots

Fields

FieldHeight

public const float FieldHeight;

The height of a top-bar field, matching Display and Workspace.

FieldY

public const float FieldY;

The y position of a top-bar field in the 40-pt tab bar, matching Display and Workspace.

Methods

Field

public static bool Field(Rect rect, string iconGlyph, string label, bool active = false)

Draws a dropdown-style field with an icon, label and chevron, like Display. Use it for a field that opens a custom popup.

ParameterTypeDefaultDescription
rectRectThe rect in GUI coordinates of the current view.
iconGlyphstringAn icon name.
labelstringThe label.
activeboolfalseWhether the field is active.

Returns: True when clicked.

FieldWidth

public static float FieldWidth(string label)

Gets the natural width of a Field with this label, including padding, glyph, chevron and 8-point gaps.

ParameterTypeDescription
labelstringThe label.

Returns: The width in points.

Register

public static void Register(Slot slot)

Adds a slot. Adding the same delegate again does nothing.

ParameterTypeDescription
slotSlotThe slot.

Call from an [InitializeOnLoad] static constructor on the main thread. A slot that throws is logged and does not stop the others.

RepaintLive

public static void RepaintLive(SceneView view)

Repaints the top bar live instead of from its cache. Call it for a slot whose content changes without input, such as a progress readout.

ParameterTypeDescription
viewSceneViewThe 3D view.

Unregister

public static void Unregister(Slot slot)

Removes a slot.

ParameterTypeDescription
slotSlotThe slot.