# 🧹 Trenchbroom Integration

# Exposing Entities

Every time you build your game, Nuake will export prefabs and all your entities defined in your C# projects to Trenchbroom. You have to manually reload the entity definitions in Trenchbroom by pressing `F6` to see the reflected changes.

## Prefabs

Any prefab you have created in a project will be automatically exported and display in Trenchbroom. If the root entity of your prefab happens to have a C# script with exposed variables, then they should show up in *Trenchbroom* as well, allowing you to override them directly in the level editor.

## Point entities

Using the C# API, you can create new point entities by simply defining a new `Entity Script` and adding the `PointScript` attribute to the class.


Here is an example of a simply relay point script. It’s role is to relay the signal received to it’s targets.

```csharp
using Nuake.Net;

namespace MyGame
{
    [PointScript("This relays a signal to it's targets")]
    class Relay : Entity
    {
        // ... 
        
        public override void Activate(Entity triggeredFrom)
        {
            foreach(Entity target in Targets)
            {
                target.Activate(triggeredFrom); // relay the original invoker
            }
        }
    }
}
```


After building your game’s code and refreshing Trenchbroom(by pressing `F6`), you should now see your newly created `Relay` point entity in the entity browser! As easy as that!

## More options

If you wish to customize even more the look in *Trenchbroom*, there are multiple available parameters you can edit in the `PointScript `attribute.

| Property name | Type | Description |
|---------------|------|-------------|
| Color         | `Color` | Changes the color of the gizmo in *Trenchbroom* |
| Base          | `String` | Allows you to group entities together |
| AABB          | `AABB` | Display a bounding box of that size in *Trenchbroom* |
| Model         | `string` | Will render that 3D model as a visual aid in *Trenchbroom* |
| ModelScale    | `float` | The scaling factor of that model |

## Brush entities

---

**Documents**

- [Project Status](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/project-status-6fyDviuXlE)
- [Welcome](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/welcome-yF3kGz8XH3)
- [Workflow](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/workflow-S9ota9vgbD)
- [Scene](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/scene-HdnkvdILFd)
- [Scripting](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/scripting-LI3IE46tt2)
- [UI](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/ui-ZW3OQfS29Z)
- [Debugging](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/debugging-UmswlxDLyv)
- [Modules](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/modules-h26DveHarI)