A comprehensive graph-based dialogue system for Unity featuring character portraits, variables, conditional branching, and a powerful visual editor. Universal input compatibility supports both legacy Input Manager and new Input System. Zero configuration required - works out of the box. Perfect for RPGs, visual novels, and story-driven games.
- Visual Graph Editor: Intuitive node-based dialogue creation with real-time editing
- Character System: Rich character portraits with expression support
- Variable System: Persistent dialogue state with type-safe variables
- Conditional Logic: Complex branching with AND/OR operations
- Function Integration: Custom game function execution
- UI Framework: Complete UI system with typewriter effects and keyboard navigation
- Universal Input Support: Works with both legacy Input Manager and new Input System automatically
- Zero Configuration: Plug-and-play setup with automatic runtime configuration
- Production Ready: Clean logging and professional error handling
- Audio Support: Character voice integration (architecture in place)
- Editor Tools: Custom property drawers and enhanced inspectors
- Open Unity Package Manager (Window → Package Manager)
- Click the "+" button in the top-left corner
- Select "Add package from git URL"
- Enter the git URL for this repository
- Click "Add"
- Copy the
DialogueSystemfolder to your Unity project'sAssetsdirectory - Ensure you have the required dependencies:
- TextMeshPro (3.0.6+)
- Unity UI (1.0.0+)
After installing the package:
- Open Package Manager (Window → Package Manager)
- Select "In Project" and find "Dialogue System"
- Click "Import" next to "Complete Dialogue System" sample
- Sample assets will be imported to
Assets/Samples/Dialogue System/[version]/Complete Dialogue System/
This package automatically supports both Unity's input systems:
- Legacy Input Manager: Works out of the box with no setup required
- New Input System: Automatically detected and used when package is installed
- Hybrid Support: Gracefully falls back between systems for maximum compatibility
- Zero Configuration: No setup required regardless of which input system you use
The system automatically creates runtime settings with sensible defaults (T and E for interaction, Space and Enter for continuation). For custom configurations, you can:
- Create a DialogueInputSettings asset: Right-click → Create → Dialogue System → Input Settings
- Place it in a Resources folder to be automatically detected
- Or assign it directly to DialogueUI, DialogueSelectionUI, or DialogueTrigger components
-
Create a Speaker Database:
- Right-click in Project → Create → Dialogue System → Speaker Database
- This will centrally manage all your characters
-
Create Characters:
- Right-click in Project → Create → Dialogue System → Character
- Configure character name and default portrait for each character
-
Add Characters to Speaker Database:
- Select your Speaker Database asset
- Add all your Character assets to the Characters list
-
Create Dialogue Graphs:
- Right-click in Project → Create → Dialogue System → Dialogue Graph Asset
- Open the graph via Window → App UI Dialogue → Graph Window
- Add Speech nodes for dialogue lines
- Add Choice nodes for branching conversations
- Connect nodes to create dialogue flow
-
Setup Components with Required Assets:
- Add DialogueTrigger to NPCs for world interaction
- Add DialogueRunner to your scene for dialogue execution
- Assign your Speaker Database to both components
- Assign specific dialogue graphs to DialogueTrigger
- Create/assign DialogueInputSettings for input configuration
-
Setup UI:
- Use the provided UI prefabs from imported samples, or
- Create custom UI and assign to DialogueRunner
- Ensure UI components reference the DialogueRunner
After importing the sample, you'll find:
Assets/Samples/Dialogue System/[version]/Complete Dialogue System/
├── Art/
│ ├── Characters/ # Character portraits (Ange, Marshal)
│ └── UI/ # UI sprites and frames
├── Prefabs/
│ ├── DialogueContinueButton.prefab
│ ├── DialogueChoiceButton.prefab
│ └── UI.prefab # Complete dialogue UI setup
├── Resources/
│ ├── Dialogue/ # Sample characters and dialogue graphs
│ ├── DialogueInputSettings.asset
│ └── Fonts/ # Sample font assets
└── Scenes/
└── Dialogue.unity # Demo scene with working dialogue
- Copy Sample Assets: Move the imported sample assets to your project's main Assets folder
- Use Sample UI: Drag the
UI.prefabto your scene - Test Demo Scene: Open
Dialogue.unityto see the system in action - Reference Sample Setup: Use the sample
SpeakerDatabase.assetand characters as templates
- DialogueRunner: Core execution engine for dialogue processing
- DialogueUI: Main UI controller with typewriter effects and navigation
- DialogueGraphAsset: ScriptableObject container for dialogue graphs
- DialogueNode: Abstract base class for all dialogue nodes
- DialogueConnectionNode: Base class for connected nodes
- SpeechNode: Character dialogue delivery
- ChoiceNode: Multiple choice branching with dynamic buttons
- ConditionalNode: Variable-based logic with AND/OR support
- FunctionNode: Custom game function execution
- VariableSetNode: Game state manipulation
- DialogueVariableManager: Singleton for persistent state management
- DialogueVariable: Type-safe variable container with JSON serialization
- Character: Character configuration with portraits and audio
- SpeakerDatabase: Centralized character registry
- DialogueTrigger: World interaction component
- DialogueSelectionUI: Multiple dialogue option selection
- DialogueInputSettings: Centralized input configuration
- DialogueOption: Data structure for dialogue choices
- PortraitAttribute: Enhanced editor property attribute
- DialogueGraphWindow: Main visual editor with split-pane interface
- DialogueGraph: GraphView implementation for node editing
- DialogueGraphAssetEditor: Custom inspector for dialogue assets
- CharacterEditor: Enhanced character asset inspector
- CharacterPropertyDrawer: Custom property drawer for characters
- DialogueTriggerEditor: Custom editor for dialogue triggers
// Create a dialogue graph asset
var dialogueGraph = CreateInstance<DialogueGraphAsset>();
// Access via DialogueRunner
var runner = FindObjectOfType<DialogueRunner>();
runner.StartDialogue(dialogueGraph);// Set variables
DialogueVariableManager.Instance.SetVariable("playerGold", 100);
DialogueVariableManager.Instance.SetVariable("questComplete", true);
// Get variables
int gold = DialogueVariableManager.Instance.GetVariable<int>("playerGold");
bool isComplete = DialogueVariableManager.Instance.GetVariable<bool>("questComplete");// Create character in editor or via code
var character = CreateInstance<Character>();
character.characterName = "Hero";
character.defaultPortrait = heroSprite;
// Add to speaker database
speakerDatabase.characters.Add(character);DialogueSystem/
├── Runtime/
│ ├── NodeTypes/ # All dialogue node implementations
│ ├── VariableSystem/ # Variable management system
│ ├── DialogueRunner.cs # Core dialogue execution
│ ├── DialogueUI.cs # Main UI controller
│ ├── Character.cs # Character system
│ └── ... # Other runtime components
├── Editor/
│ ├── DialogueGraphWindow.cs # Visual graph editor
│ ├── DialogueGraph.cs # Graph view implementation
│ └── ... # Editor tools and property drawers
├── Samples/
│ ├── Prefabs/ # UI prefabs and examples
│ ├── Resources/ # Sample dialogue assets
│ └── Art/ # Character portraits
└── package.json # Package configuration
Create custom dialogue nodes by inheriting from DialogueNode:
[CreateAssetMenu(fileName = "CustomNode", menuName = "Dialogue System/Custom Node")]
public class CustomNode : DialogueNode
{
public override void Execute(DialogueRunner runner)
{
// Custom node logic
ExecuteConnectedNodes(runner);
}
public override string GetDisplayText()
{
return "Custom Node";
}
}Use complex conditional logic in ConditionalNode:
// AND condition: playerLevel >= 5 AND questComplete == true
// OR condition: hasKey == true OR isAdmin == trueExecute custom game functions via FunctionNode:
// Functions can modify game state, give items, etc.
public void GivePlayerGold(int amount)
{
PlayerInventory.AddGold(amount);
DialogueVariableManager.Instance.SetVariable("playerGold",
PlayerInventory.GetGold());
}The system supports dual keybinding through DialogueInputSettings:
- Continue Dialogue: Space or Enter
- Skip Typewriter: Space or Enter
- Navigate Choices: Arrow keys
- Select Choice: Enter or Return
The system provides comprehensive validation:
- Visual warning indicators for unconnected nodes
- Character assignment validation
- Variable reference checking
- Graph flow validation
- Efficient node execution with connection caching
- Minimal garbage collection during dialogue playback
- Optimized UI updates with pooled components
- JSON serialization for fast variable persistence
- Unity Version: 2022.3+
- Render Pipeline: Universal Render Pipeline (URP) compatible
- Input System: Both old and new input systems supported
- Platform: Cross-platform compatible
When extending the system:
- Follow existing code patterns and naming conventions
- Add comprehensive validation for new node types
- Include editor tools for new components
- Update documentation for new features
This package is provided as-is for use in Unity projects. See the project license for full details.
For questions and support, refer to the project documentation or contact the development team.