Get RAPTOR

RaptorSuiteInspectorBlocks

Registry of Inspector blocks.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0
public static class RaptorSuiteInspectorBlocks

Properties

All

public static IReadOnlyList<RaptorSuiteInspectorBlock> All { get; }

Gets the selection blocks in registration order. Anchored blocks are in Anchored.

Anchored

public static IReadOnlyList<RaptorSuiteInspectorBlock> Anchored { get; }

Gets the blocks anchored to a section (RaptorSuiteInspectorBlock.Section set), in registration order.

HiddenComponentTypes

public static IReadOnlyList<Type> HiddenComponentTypes { get; }

Gets the hidden component types in registration order.

Methods

HideComponentType

public static void HideComponentType(Type componentType)

Hides the raw component section for componentType and its derived types in the Inspector. Use it when a module draws a custom block for that component. Hiding a type again has no effect. Call from an [InitializeOnLoad] static constructor. Throws ArgumentNullException for null and ArgumentException for a type that is not a Component.

ParameterTypeDescription
componentTypeTypeThe component type.

HidesComponent

public static bool HidesComponent(Component component)

Whether the raw section for component is hidden because its type is, or derives from, a hidden type. Returns false for null.

ParameterTypeDescription
componentComponentThe component.

Returns: True when hidden.

OpenDrawer

public static bool OpenDrawer(string id)

Opens the drawer panel id in the open Suite window through RaptorSuiteWindow.OpenDrawer. Use it for a block's "Show in ... drawer" action. Returns false when no Suite window is open or side tabs are off.

ParameterTypeDescription
idstringThe drawer panel's id.

Returns: True when it opened.

Register

public static void Register(RaptorSuiteInspectorBlock block)

Adds a block, anchored when RaptorSuiteInspectorBlock.Section is set. A block with the same Id replaces the earlier one. A null block or an empty Id is ignored.

ParameterTypeDescription
blockRaptorSuiteInspectorBlockThe block.

Call from an [InitializeOnLoad] static constructor on the main thread.

ShowComponentType

public static bool ShowComponentType(Type componentType)

Undoes HideComponentType.

ParameterTypeDescription
componentTypeTypeThe component type.

Returns: False when it was not hidden.

Unregister

public static void Unregister(RaptorSuiteInspectorBlock block)

Removes a block registered with Register. Does nothing when the block is not registered.

ParameterTypeDescription
blockRaptorSuiteInspectorBlockThe block.