A simple and reusable dialogue system for Unity using C# and TextMeshPro.
This system allows players to navigate dialogue using Previous, Next, and Finish buttons.
- Simple dialogue navigation
- Previous and Next button support
- Automatic Finish button activation
- Easy Inspector setup
- TextMeshPro support
- Beginner-friendly
- Unity 2020 or higher
- TextMeshPro Package
- Unity UI System
- Download or clone this repository.
git clone https://github.com/yourusername/unity-dialogue-manager.git-
Open your Unity project.
-
Import the script into your project.
-
Import TMP Essentials:
- Window → TextMeshPro → Import TMP Essentials
Inside your Canvas:
- Create a Panel
- Add a TextMeshPro Text object
- Add 3 Buttons:
- Previous
- Next
- Finish
- Create an Empty GameObject
- Rename it to
DialogueManager - Attach
DialogueManager.cs
In the Inspector:
| Field | Assign |
|---|---|
| Dialogue Text | TMP Text |
| Prev Button | Previous Button |
| Next Button | Next Button |
| Finish Button | Finish Button |
Under Dialogue Content, add your dialogue messages.
Example:
Hello player!
Welcome to the game.
Good luck on your adventure!
Assign the button OnClick events:
| Button | Function |
|---|---|
| Previous | ShowPreviousLine() |
| Next | ShowNextLine() |
| Finish | FinishDialogue() |
- NPC conversations
- Tutorials
- Story dialogue
- Visual novels
- Interactive lessons
- Typing effect
- Dialogue portraits
- Sound effects
- Branching dialogue choices
- JSON dialogue support
Free to use for educational and commercial projects.
Stix&Kno