Editor Tools
Editor Tools
The AI NPC Brain package includes several editor-only tools and custom inspectors that automate common setup tasks. All tools are under the Tools > AI NPC Brain menu.
NPC Animation Setup
Menu: Tools > AI NPC Brain > NPC Animation Setup
Script: Editor/NpcAnimationSetupWindow.cs
The full animation pipeline tool. This is the recommended way to set up NPC animations.
What It Does
- Scans an AnimatorController for Trigger parameters
- Creates
AnimTriggerBindingentries in yourNpcAnimationMapasset - Auto-generates semantic
animIdvalues (lowercased trigger names) - Suggests
usageHinttext so the LLM knows when to use each animation - Assigns
moodTagcategories for filtering and prompt logic - Syncs allowed
anim_idvalues into theNpcEventCatalog - Syncs default
move_idvalues into the catalog
How to Use
- Open Tools > AI NPC Brain > NPC Animation Setup.
- Assign your three assets:
- Animator Controller — the controller with trigger parameters
- NPC Animation Map — the map asset to fill
- NPC Event Catalog — the catalog to sync allowed values into
- Configure options:
- Overwrite existing map entries — replaces entries that already exist
- Overwrite existing usage hints / mood tags — updates hints even if they were manually edited
- Convert animId to lowercase —
Wavebecomeswave(recommended) - Sort animation map entries — alphabetical ordering
- Run the steps in order, or click Do Everything to run all three:
- Step 1: Scan Animator -> Fill Animation Map — reads triggers, creates bindings
- Step 2: Sync anim.trigger Allowed Values -> Event Catalog — copies all
animIdvalues into theanim.triggerevent's allowed values - Step 3: Sync Default move_id Allowed Values -> Event Catalog — writes default movement IDs into
anim.move_to
Default Movement IDs
Step 3 writes these movement IDs into the catalog:
| move_id | Description |
|---|---|
step_forward |
Small step forward |
step_back |
Small step backward |
approach_player |
Walk to player anchor |
leave_player |
Walk to idle anchor |
circle_left |
Circle left |
circle_right |
Circle right |
Usage Hint Auto-Generation
The tool suggests usage hints based on trigger name keywords:
| Keyword | Suggested Hint |
|---|---|
| nod | "Use when agreeing, confirming, or showing understanding." |
| shrug | "Use when unsure, uncertain, or unable to answer." |
| wave | "Use for greetings, farewells, or friendly acknowledgement." |
| smile | "Use when warm, pleased, affectionate, or encouraging." |
| laugh | "Use when amused, playful, or joking." |
| point | "Use when giving directions or emphasizing something specific." |
| angry | "Use when frustrated, irritated, or upset." |
| sad | "Use when sympathetic, regretful, or disappointed." |
| bow | "Use when respectful, formal, apologetic, or deferential." |
| idle | "Use as a subtle neutral motion when speaking normally." |
| think | "Use when considering something carefully." |
| talk | "Use as a general speaking gesture if no more specific animation fits." |
Mood Tag Auto-Assignment
| Keyword | Mood Tag |
|---|---|
| nod, smile, laugh | Positive |
| shrug, think | Unsure |
| wave, greet | Greeting |
| point | Emphatic |
| angry, sad | Negative |
| bow | Farewell |
| idle, blink, talk | Neutral |
Animation Map Auto-Fill
Menu: Tools > AI NPC Brain > Animation Map Auto-Fill
Script: Editor/NpcAnimationMapAutoFillWindow.cs
A simpler version of the NPC Animation Setup tool. Only does Step 1 (scan triggers and fill the animation map). Does not sync to the catalog.
How to Use
- Open Tools > AI NPC Brain > Animation Map Auto-Fill.
- Assign:
- Animator Controller — the controller to scan
- NpcAnimationMap — the map to fill
- Options:
- Overwrite existing entries — replaces entries with the same animator trigger
- Use lowercase animId — converts trigger names to lowercase
- Click Add Trigger Parameters to Map.
Use Print Trigger List to Console to see what triggers exist on your controller without modifying anything.
Custom Inspector: NpcUiBindings
Script: Editor/NpcUiBindingsEditor.cs
When you select an NpcUiBindings asset, the Inspector shows two utility buttons:
Auto-Generate IDs from npcId
Fills in shopWindowId, questBoardWindowId, and relationshipWindowId from the npcId field using the pattern:
{npcId}.shop
{npcId}.quest_board
{npcId}.relationship
Example: If npcId = npc_aurelia_alchemist, clicking this button sets:
- shopWindowId = npc_aurelia_alchemist.shop
- questBoardWindowId = npc_aurelia_alchemist.quest_board
- relationshipWindowId = npc_aurelia_alchemist.relationship
Sync Into Selected NpcEventCatalog Asset
- Select an
NpcEventCatalogasset in the Project window. - Click this button on the
NpcUiBindingsInspector. - The tool writes the window IDs into the matching event arg
allowedValues: shop.open→shop_idallowed =shopWindowIdshop.sell_mode→shop_idallowed =shopWindowIdquest.open_board→quest_board_idallowed =questBoardWindowId
This ensures the event catalog's allowed values always match the NPC's actual window IDs.
Custom Inspector: WindowRegistryRuntime
Script: Editor/WindowRegistryRuntimeEditor.cs
When you select a GameObject with WindowRegistryRuntime, the Inspector shows these utility buttons:
Assign Window IDs to 3 Panels from NpcUiBindings
Requires uiBindings, shopPanel, questBoardPanel, and relationshipPanel to be assigned on the component.
- Auto-generates IDs on the
NpcUiBindingsifautoGenerateFromNpcIdis enabled. - Adds a
WindowPanelIdcomponent to each panel (if not already present). - Sets the
windowIdon eachWindowPanelIdfrom the bindings.
Auto-Populate From Scene
Finds every WindowPanelId component in the entire scene and rebuilds the bindings list from them. Each panel's windowId becomes a binding entry.
Auto-Populate ONLY Under searchRoot
Same as above, but only searches under the searchRoot transform (or this GameObject if searchRoot is null). Useful when you have multiple NPC registries in one scene.
Close All (Editor Preview)
Deactivates every panel in the bindings list. Useful for resetting panel states while editing.
NpcCatalogSyncUtility
Script: Editor/NpcCatalogSyncUtility.cs
A static utility class used internally by the NpcUiBindingsEditor. You can also call it from your own editor scripts:
NpcCatalogSyncUtility.Sync(myBindings, myCatalog);
This writes window IDs from NpcUiBindings into the corresponding event arg allowedValues in the NpcEventCatalog.
Typical Setup Workflow
Here is the recommended order of operations when setting up a new NPC:
- Create assets:
- Persona Definition (set npcId, displayName, personaJson)
- Brain Config (set provider, API key, tuning)
- Event Catalog (add your events with arg schemas)
- NPC Animation Map (leave empty for now)
-
NPC UI Bindings (set npcId, click Auto-Generate IDs)
-
Set up animations:
- Open Tools > AI NPC Brain > NPC Animation Setup
- Assign Animator Controller, Animation Map, and Event Catalog
-
Click Do Everything
-
Sync UI bindings to catalog:
- Select your NPC UI Bindings asset
- Select your Event Catalog asset in the Project window
-
Click Sync Into Selected NpcEventCatalog Asset
-
Set up scene panels:
- Add
WindowPanelIdto each panel root, or: -
Use the
WindowRegistryRuntimeInspector to assign IDs and auto-populate -
Wire everything in the scene:
- Add
AiNpcBrainto the NPC, assign all assets - Add receivers, wire
OnAnyNpcEventPayload - Add chat UI, wire to brain
- Press Play