RAPTOR API
The C# API for connecting RAPTOR to your game and tools.
You can build, light and play a level without code, as described in the Docs. Use the API to connect RAPTOR to your own systems, such as a player character, multiplayer host, toolbar tool or model storage.
What you can do with it
| You want to | Start with |
|---|---|
| Let Logic move, teleport and freeze your character | Your own character |
| Replace the use key with your own input, or let your weapons damage logic objects | Your own character |
| Run Logic on your own host, such as a networked game | Your own character |
| Add a tool to the toolbar, rows to the Inspector or a page to Project Settings | Writing a module |
| Change how a Block is built, such as adding bevels | Block extension points |
| Add a new kind of object to the 3D view and Hierarchy | Tool extension points |
| Save and load models through another storage system | Model storage |
| Read RAPTOR's baked light volume in a custom shader | Shader API |
All other entry points are listed in Extension points.
How the API is organised
The Reference menu has one fold-out per area and one page per type.
| Area | What it covers |
|---|---|
| Play and Logic | Player character, Play button and Logic host. |
| Modules and project | Module rows, data folders, preferences, project settings and credits. |
| Window and panels | RAPTOR's window, panels, slots and dialogs. |
| Tools and menus | Toolbar tools, Inspector rows, menu rows and shortcut rows. |
| 3D view | Drawing in the 3D view, picking and custom scene objects. |
| Blocks | How a Block builds and the data a module stores on it. |
| Models | Building, saving, naming and moving parts. |
| Materials and hotspots | Packs, the Materials drawer, hotspot sheets and shaders. |
| Lighting and rendering | Light backends, bake backends and the Ray-traced preview. |
| Props and entities | The prop list, placement modes and entity bodies. |
| UI kit | RAPTOR's controls, theme and icons. |
Reading a type page
Each type page has these parts, in order:
- Header table. Namespace, assembly, kind (class, interface, struct or enum) and stability.
- Declaration. The C# line that declares the type.
- Members. Grouped as Constructors, Values, Fields, Properties, Methods and Events. Each has its signature, a description and a parameter table.
- Related types. Types the page mentions.
Supported and unsupported
Only the types and members in this reference are supported. Other public code in RAPTOR can change in any update. To request something that is not listed, ask on Discord.
| Stability | What it means |
|---|---|
preview | Can change in a minor version, such as 1.1. Changes are listed in the changelog. |
experimental | Can change in any release. Pages for these types start with a warning. |
Assemblies
Reference RAPTOR's assemblies by GUID from your assembly definition (.asmdef). A GUID reference keeps working if an assembly is renamed.
| Assembly | Reference it when | Runs in |
|---|---|---|
Raptor.Editor | Always, for editor code. | Editor |
Raptor.Components | You use Blocks, per-Block data or the local player. | Editor and game |
Raptor.MeshCore | You write a Block modifier. | Editor |
Raptor.Logic.Runtime | You claim Logic or call the local host. | Editor and game |
RaptorLogic.Core | You read LogicModules. | Editor and game |
RaptorRender.Editor | You add a light to the Ray-traced preview. | Editor |
Copy the reference into the references list of your .asmdef, and the namespace into your using directive:
| Assembly | Reference | Namespace |
|---|---|---|
Raptor.Editor | GUID:be077b987e64af8408d00913e39c042c | Raptor.EditorTools |
Raptor.Components | GUID:38389940f44407c4c9afe23c03d52cef | Raptor.Components |
Raptor.MeshCore | GUID:397ea669cfa6fc641bea09678decab17 | |
Raptor.Logic.Runtime | GUID:545294e6f7ec493f99097086d14ee328 | Raptor.Logic |
RaptorLogic.Core | GUID:e25f1191e2a449849b11b698eac02212 | RaptorLogic |
RaptorRender.Editor | GUID:15d69a4210e29ac42aa76d8df4a37885 | Raptor.Render.EditorTools |
Included samples
Assets/RAPTOR/Samples/ModuleTemplate is a minimal working module. Assets/RAPTOR/Samples/LogicStarter is a level that runs Logic without code.