Source Code Structure

Namespaces

All source code is contained within the namespace hierarchy PixelCrushers.DialogueSystem.

In code, you'll probably only ever need to reference the scripts in PixelCrushers.DialogueSystem, and possibly PixelCrushers.DialogueSystem.UnityGUI if you use Unity GUI. The scripts in third party support packages use their own sub-namespaces such as PixelCrushers.DialogueSystem.NGUI.

Lua functionality, provided by LuaInterpreter written by Liu Junfeng and used under MIT License, is contained in the namespace Language.Lua.


Core

The Dialogue System uses a Model-View-Controller (MVC) architecture:

MVC Description
Model State of the dialogue database, Lua, and active conversation
View Dialogue UI (subtitles, response menu, and sequencer)
Controller Mediates between the model and the view

The Core folder contains the Model-View-Controller scripts as well as custom editor scripts, the DialogueSystemController component that provides a single control interface for the MVC, and the DialogueManager singleton class that wraps the DialogueSystemController for easy access.


Supplemental

The Supplemental folder contains important Dialogue System modules that are built on top of the core modules. These include triggers, the Save System, the Quest System, and Unity GUI implementations of IDialogueUI and IBarkUI.


Third Party Support

The Third Party Support folder contains Unity packages to support third party products such as NGUI, uSequencer, and PlayMaker.


Templates

The Templates folder contains templates that you can copy to create your own implementations of dialogue UIs, bark UIs, sequencer commands, and persistent data recorders.

Template Description
PersistentDataTemplate.cs Template for persistent data components (see Persistent Data Components)
SequencerCommandTemplate.cs Template for sequencer commands (see How to Write Custom Sequencer Commands)
TemplateBarkUI.cs Template for bark UIs (see Bark UI)
TemplateDialogueUI.cs Template for dialogue UIs (see How to Make a Custom Dialogue UI)
TemplateQuestLogWindow.cs Template for quest log windows (see Quest Log Window)
TemplateTextFieldUI.cs Template for TextFieldUI (see Text Field UI)
Aurora/TemplateNWScript.cs Template for NWScript() Lua function (Neverwinter Nights)

<< How to Unpack the Source Code | Script Component Overview>>