Get RAPTOR

RaptorPropTool

Connects RAPTOR's prop placement (the Props drawer and Place tool) to the project's prop catalogue.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

The project's prop catalogue lives in project code and cannot access this assembly's internals, so only plain Unity types and plain data pass through this class.

Each hook and provider field holds one provider. The last assignment wins, and null restores the built-in behaviour.

public static class RaptorPropTool

Fields

BehaviourWiringHook

public static System.Action<GameObject, bool, bool, bool, string> BehaviourWiringHook;

Applies the armed behaviour to a newly placed prop instance. Receives the instance, the breakable, fixedToWall and physics flags, and the breakable category GUID.

CatalogProvider

public static System.Func<RaptorPropRecord[]> CatalogProvider;

Returns every catalogue entry as plain data. The bridge repairs moved paths once per domain reload. When null, the drawer lists RaptorBasicPropCatalog.

CatalogRebuildHook

public static System.Action CatalogRebuildHook;

Rebuilds the prop catalogue from the project's assets with a full rescan, then increments CatalogVersion. The Props drawer offers its Scan chip on an empty catalogue only while this is set.

CatalogVersion

public static int CatalogVersion;

Incremented by the bridge whenever the project's assets change, so the drawer re-reads the catalogue.

FamilyOrder

public static string[] FamilyOrder;

The sidebar order of the source families.

MaterialRoutingHook

public static System.Action<GameObject, bool> MaterialRoutingHook;

Routes a newly placed prop instance's materials to the shader for its role. Receives the instance and isStatic. Static props use BakeryURPSHGraph (lightmap contributor) and all others use URP Unlit, the same variants the runtime wrapper bake uses. The bridge points renderer slots at cached variant materials and does not modify the source materials.

PaletteProvider

public static System.Func<RaptorPropPalette[]> PaletteProvider;

Returns the prop palettes in the user's order. Null when there is no bridge.

PriorityShortcutTag

public const string PriorityShortcutTag;

The tag a priority shortcut binding carries: [Shortcut(id, typeof(MyContext), RaptorPropTool.PriorityShortcutTag, KeyCode.R)]. Only tagged bindings in a promoted context take priority for their key.

Properties

ActiveMode

public static RaptorPropMode ActiveMode { get; }

Gets the mode that is on, or null for the plain Prop tool.

ModeKeysLive

public static bool ModeKeysLive { get; }

Whether a RAPTOR view has keyboard focus (no Settings page, dialog, text field or module canvas), the Prop tool is on and a mode is on. Use it as the active check for a mode's shortcut context.

Modes

public static IReadOnlyList<RaptorPropMode> Modes { get; }

Gets every registered mode in registration order. Each has a chip on the Prop band.

Methods

CategoryListProvider

public static System.Func<bool, (string guid, string name)[]> CategoryListProvider;

Returns the asset GUID and display name of every BreakableCategory. When the argument (wantAnchored) is true, only Anchored categories (FIXED+BREAK) are returned; when false, only Standard ones (BREAK alone).

DrawGhost

public static void DrawGhost(Mesh mesh, Material material, Matrix4x4 trs)

Draws the Prop tool's ghost: a depth-primed translucent copy of material with a bounds wireframe. Call during Repaint only.

ParameterTypeDescription
meshMeshThe mesh.
materialMaterialThe material the ghost copies.
trsMatrix4x4The world matrix.

DrawIcon

public static void DrawIcon(Rect rect, string glyphName, Color tint, float size = 16f)

Draws an icon in the Suite's style. Call during Repaint only.

ParameterTypeDefaultDescription
rectRectThe rect, in the current view's GUI coordinates.
glyphNamestringThe icon name.
tintColorThe tint, multiplied with the icon.
sizefloat16fThe size in points.

EnterMode

public static void EnterMode(string id)

Switches to mode id, or back to plain props when id is null. Equips the Prop tool if needed.

ParameterTypeDescription
idstringThe mode's Id, or null for plain props.

IsShortcutContextPromoted

public static bool IsShortcutContextPromoted(IShortcutContext context)

Whether context was promoted by PromoteShortcutContext.

ParameterTypeDescription
contextIShortcutContextA context registered with ShortcutManager.

Returns: True when promoted.

PickSurface

public static bool PickSurface(SceneView view, Vector2 mouse, Func<GameObject, bool> reject, out Vector3 point, out Vector3 normal, out RaptorModel model, out GameObject hitObject)

Same as the other PickSurface overload, but looks through objects that reject returns true for, such as the object being dragged. Call from pointer events only.

ParameterTypeDescription
viewSceneViewThe 3D view.
mouseVector2The pointer in GUI coordinates.
rejectFunc<GameObject, bool>Returns true for an object to look through.
pointout Vector3The surface point.
normalout Vector3The surface normal.
modelout RaptorModelThe model.
hitObjectout GameObjectThe object hit.

Returns: False when no surface is under the pointer.

PickSurface

public static bool PickSurface(SceneView view, Vector2 mouse, out Vector3 point, out Vector3 normal, out RaptorModel model, out GameObject hitObject)

Picks the visible surface under mouse in a RAPTOR 3D view, as the Prop tool does (GPU pick and CPU raycast, falling back to the work plane). This renders, so call it from pointer events only, not during Layout or Repaint.

ParameterTypeDescription
viewSceneViewThe 3D view.
mouseVector2The pointer in GUI coordinates.
pointout Vector3The surface point.
normalout Vector3The surface normal.
modelout RaptorModelThe model.
hitObjectout GameObjectThe object hit.

Returns: False when no surface is under the pointer.

PlaceRefusal

public static string PlaceRefusal(RaptorModel model)

Returns why placing into model is refused (a room of the wrong kind, or a linked block), or null.

ParameterTypeDescription
modelRaptorModelThe model.

Returns: The reason, or null.

PromoteShortcutContext

public static string PromoteShortcutContext(IShortcutContext context, string errorLead, string errorTail)

Promotes a context already registered with ShortcutManager. While the context is active, its bindings tagged with PriorityShortcutTag take priority for their key over Unity's and RAPTOR's, without a conflict dialog. If the tag cannot be registered, a warning is logged once and the context stays inactive; check IsShortcutContextPromoted in the context's active property.

ParameterTypeDescription
contextIShortcutContextA context registered with ShortcutManager.
errorLeadstringThe start of the warning if promotion fails.
errorTailstringThe end of the warning.

Returns: The reason promotion failed, or null on success.

PropsParent

public static Transform PropsParent(RaptorModel model, Scene scene, string undoLabel)

Returns the parent for a placed prop: the hit model's Props container, otherwise the scene's root "Props" object (created with Undo).

ParameterTypeDescription
modelRaptorModelThe model.
sceneSceneThe scene.
undoLabelstringThe undo step's name.

Returns: The parent.

RegisterMode

public static void RegisterMode(RaptorPropMode mode)

Registers a Prop-tool mode, replacing any mode with the same RaptorPropMode.Id.

ParameterTypeDescription
modeRaptorPropModeThe mode.

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

RepaintSuite

public static void RepaintSuite()

Repaints every open Suite window.

Toast

public static void Toast(string message)

Shows a toast message in the Suite.

ParameterTypeDescription
messagestringThe message text.
  • RaptorBasicPropCatalog: RAPTOR's built-in prop catalogue, used by the Props drawer when no project catalogue is registered.
  • RaptorPropPalette: A prop palette (a user's collection), as plain data.
  • RaptorPropRecord: One prop catalogue entry, as plain data.
  • RaptorPropMode: An alternative placing workflow inside the Prop tool, registered by project code.
  • RaptorModel: The root of a RAPTOR model and its output container.