A professional Unity Editor Tool designed to streamline the creation of dynamic NPC dialogues. This tool simulates AI-driven text generation using asynchronous calls (async/await) to prevent editor freezing and utilizes JSON Serialization to save generated data for in-game implementation.
(This tool allows developers to generate and save dialogues without leaving the Unity Editor)
- Custom Editor Window: Built entirely using Unity's
EditorWindowAPI for a native look and feel. - Asynchronous Execution: Uses C#
Taskandasync/awaitpatterns to handle generation delays without locking the main thread. - Diverse Personas: Includes a mock database with 6 distinct characters (e.g., Wretched Beggar, Goblin Scout, Mysterious Wizard) and over 120 unique lines.
- JSON Save System: Successfully generated dialogues can be serialized and exported to
.jsonfiles with a single click. - UX/UI Design: Features conditional buttons, loading states, and user feedback loops.
The tool extends EditorWindow to create a custom interface within Unity.
[MenuItem("My AI Tools/Dialogue Generator")]
public static void ShowWindow()
{
GetWindow<DialogueWindow>("AI Dialogue Tool");
}Instead of legacy Coroutines, modern Task based asynchronous programming is used to simulate API latency.
async void GenerateMockDialogue()
{
isGenerating = true;
await Task.Delay(1000); // Non-blocking delay
// ... logic ...
isGenerating = false;
Repaint();
}The tool converts runtime objects into persistent data using JsonUtility.
{
"characterName": "Wretched Beggar",
"dialogueText": "[Wretched Beggar]: Alms for the poor...",
"dateCreated": "12/19/2025"
}This software and its associated documentation are the exclusive property of Berk Elmalı. No Commercial Use: You may not use this source code for commercial purposes without explicit written permission from the author. No Modification: You may not modify, distribute, or create derivative works based on this project. No Distribution: You may not host this code on any public repository or server without authorization. For permission requests, please contact the author directly.
Clone this repository.
Open the project in Unity 6 (6000.x) or later. Navigate to the top menu: My AI Tools -> Dialogue Generator.
Developed as a demonstration of Tool Programming, Editor Scripting, and System Architecture in Unity.