Description
The main runtime controller for player-facing conversations. It manages the conversation lifecycle from open to close, navigates through nodes, handles option selection, and coordinates beat playback.
One instance lives in the scene, on the Chat System prefab that Dialogue UI Service instantiates. Unlike Headless Conversation Controller, only one player conversation can be active at a time. See Player Conversations.
Interface
| Type |
|---|
| IChatFlowController |
| IRuntimeDialogueDeadEndHandler |
Inherits
Properties
| Name | Type | Description |
|---|
| CurrentNode | ChatData | The node currently being played, or null. |
Inspector Fields
Serialized private fields, set on the prefab rather than through the API.
| Name | Type | Description |
|---|
| defaultTree | ChatTreeData | Tree used when the agent supplies none. |
| activeChatTree | ChatTreeData | The tree resolved for the current conversation. |
| dialoguePanelView | DialoguePanelView | The panel this service drives. Also assignable through BindPanelView. |
Public Methods
| Name | Parameters | Return Type | Description |
|---|
| ApplyCurrentChat | IAgentService agent, IAgentService listener = null | void | Opens a conversation with the given agent, resolves the tree, and begins playback. |
| ApplyCurrentChat | string id | void | Navigates to a specific node by ID within the current conversation. |
| SelectOption | string selectedOption | void | Called when the player selects a dialogue option. |
| AdvanceBeatOrDisplayOptions | N/A | void | Advances to the next beat group, or shows options if at the last. |
| IsChatActive | N/A | bool | Returns true while a conversation is open. |
| GetActiveAgent | N/A | IAgentService | Returns the agent the player is currently talking to, or null. |
| BindPanelView | DialoguePanelView panelView | void | Binds the panel this service drives. Called during UI initialization. |
| CloseChat | N/A | void | Closes the current conversation and cleans up all session state. |
| HandleRuntimeDeadEnd | ChatData activeNode, string warning | void | Dead-end handler. Logs the warning and closes the conversation cleanly. |