# Editor Tools

***

## AIBehavior Inspector

Custom inspector with sections for:

* **Main Section** — goal stacks, initial states, world state categories
* **Actions Section** — add/remove actions via dropdown; no manual list management
* **Control Section** — behavior group, preset, reset-on-enable
* **Events** — UnityEvent bindings for all lifecycle events
* **Runtime State** — live view of current goal, action, timer, and behavior state values

***

## AIAgent Inspector

Default Unity Inspector. Exposes `_targetReachDistance` (how close the agent must be before `IsTargetReached` fires).

***

## Sensor Inspector

Custom inspector (`SensorEditor`) that applies to all `Sensor` subclasses:

* **Default Inspector fields** — all sensor configuration fields
* **Runtime Debug** *(play mode only)* — shows linked AIBehavior name, last polled value, and state key
* **Force Poll Now** button — triggers an immediate poll and logs the result to the Console

***

## TargetBinder Inspector

Custom inspector with sections for:

* **Filter** — name and group filter fields (dropdowns populated from EngineData)
* **Compatible Actions** — dropdown populated from all `Action` subclasses in the project; selected types are added to the filter list
* **Settings** — priority weight, Is Shared toggle, and Is Available toggle
* **Runtime Debug** *(play mode only)* — shows whether the binder is registered, available, and how many total binders are active

***

## GOAP Graph Editor

`Tools > Bee Labs > GOAP Engine > Graph Editor`

A node-graph view of the full action / goal stack / world state dependency network for any loaded `BehaviorPreset` or `AIBehavior`.

### Design-Time Features

* **ActionNode** — one node per action; header shows action type name, cost, and requirements/effects as ports. Disabled actions (`IsIncludeOnPlanning = false`) are shown grayed-out at 45% opacity with a `[disabled]` title suffix.
* **GoalStackNode** — one node per goal stack; goal conditions shown as input ports.
* **StatesNode** — shows `InitialStates` and all `EngineData` world state keys as output ports with their configured values.
* **Inspector Panel** — right-side panel shows a full serialized editor for the selected node. Includes all base-class fields (`Name`, `Cost`, `Timer`, `Target`, `Requirements`, `Effects`, `Parameters`, `Allow`, `Skip Effects On Complete`) **plus all subclass-specific serialized fields** automatically (e.g. `_speedMultiplier` on `ChaseAction`, `_reloadTime` on `ReloadAction`). Each action header shows its concrete type name and an **Edit Script** button to open the source file directly.
* **Node moves** — drag to reposition; positions are saved via undo-safe `GOAPLayoutProxy` ScriptableObject and persisted to `EditorPrefs`.
* **Undo/redo** — node positions and inspector changes are fully undoable.

### Play-Mode (Runtime) Overlay

* The currently executing action node is highlighted; completed and queued nodes are visually distinguished.
* The **StatesNode** live-updates with current `State` values, including runtime-only keys such as `__order_*` ordering keys and any keys produced at runtime that have no design-time port. Dynamic ports are added on play and removed on exit.
* The Inspector Panel shows a **Runtime State** section at the bottom: current goal stack, running action, timer, target name, and a live read-only view of all `State` key-value pairs.

***

## EngineData Inspector

`Assets/Create/GOAPEngine/EngineData` — place in a `Resources` folder and name it `EngineData`.

* **Groups** — defines available group identifiers used by `TargetBinder` and the AIBehavior Inspector dropdown
* **World States** — defines all world state categories (name + initial key-value pairs) auto-registered before scene load
* **Target Tags** — defines tag identifiers used by the `_targetTag` filter on actions and `TargetBinder` components

***

## Action Creator Window

`Tools > Bee Labs > GOAP Engine > Action Creator`

Generates a correctly namespaced `Action` subclass with all lifecycle methods stubbed out. Configure name, namespace, and output folder, then click **Create Action Script**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://beelabs-dev.gitbook.io/beelabs-docs/goap-engine/editor-tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
