Runtime Dialog Flow

A DialogManager resolves the requested graph, obtains a runtime dialogue view, and advances through the graph’s nodes and links.

Key files

  • Assets/DialogGraphSystem/Scripts/Runtime/Core/DialogManager.cs
  • Assets/DialogGraphSystem/Scripts/Runtime/Core/DialogActionRunner.cs
  • Assets/DialogGraphSystem/Scripts/Runtime/UI/DialogUIController.cs and UI/Theming/DialogUIManager.cs
  • Assets/DialogGraphSystem/Scripts/Runtime/Models/Nodes/*

Main responsibilities

  • resolve a graph from dialogID, or start from a graph asset
  • move between GUID-linked nodes
  • display the current Dialog line and the selectable answers from a Choice node
  • handle input, skip, and autoplay
  • invoke action nodes
  • raise events for history and integration
  • record branch paths for transcript rebuilding

Start a conversation

For ID-based startup, register a graph in DialogManager.dialogGraphs and use the same stable ID in gameplay. You can also pass a graph asset directly.

DialogManager.Instance.PlayDialogByID("intro_guard");
public DialogGraph introGraph;

void StartConversation()
{
    DialogManager.Instance.StartDialog(introGraph);
}

Events

The manager exposes events including OnLineShown, OnChoicePicked, OnConversationReset, onDialogEnter, and onDialogExit. Locale-aware line and choice events are also available when a consumer needs localization metadata. The legacy OnChoicePicked event carries the authored choice text.

Common mistakes

  • not assigning a usable DialogUIManager or configured UI prefab when the scene has no existing dialog UI
  • starting by dialogID without adding a graph mapping
  • using action nodes without a matching action binding or IActionHandler on the configured or available runner
  • assuming history alone is authoritative for exact branch reconstruction
  • treating a transcript reconstructed from the current graph as the exact localized or interpolated text a player saw