Class DialogueEngineBase
Inheritance
DialogueEngineBase
Assembly: .dll
Syntax
public abstract class DialogueEngineBase : MonoBehaviour
Fields
|
Edit this page
View Source
OnChoiceSelected
Fired when the player selects a choice. Passes the selected
Choice to listeners.
Declaration
public ChoiceEvent OnChoiceSelected
Field Value
|
Edit this page
View Source
OnChoicesPresented
Fired when choices are presented to the player. Passes the full list
of resolved Choice objects.
Declaration
public ChoiceListEvent OnChoicesPresented
Field Value
|
Edit this page
View Source
OnConversationEnd
Declaration
public UnityEvent OnConversationEnd
Field Value
| Type |
Description |
| UnityEvent |
|
|
Edit this page
View Source
OnConversationPaused
Declaration
public UnityEvent OnConversationPaused
Field Value
| Type |
Description |
| UnityEvent |
|
|
Edit this page
View Source
OnConversationResumed
Declaration
public UnityEvent OnConversationResumed
Field Value
| Type |
Description |
| UnityEvent |
|
|
Edit this page
View Source
OnConversationStart
Declaration
public UnityEvent OnConversationStart
Field Value
| Type |
Description |
| UnityEvent |
|
|
Edit this page
View Source
OnLineDisplayed
Fired after a dialogue line has been resolved and is about to be displayed.
Passes the fully resolved Line to listeners.
Declaration
public LineEvent OnLineDisplayed
Field Value
|
Edit this page
View Source
PersistentOnConversationEnd
Declaration
public UnityEvent PersistentOnConversationEnd
Field Value
| Type |
Description |
| UnityEvent |
|
|
Edit this page
View Source
PersistentOnConversationStart
Declaration
public UnityEvent PersistentOnConversationStart
Field Value
| Type |
Description |
| UnityEvent |
|
|
Edit this page
View Source
_currentConversation
Declaration
protected Conversation _currentConversation
Field Value
|
Edit this page
View Source
_isPaused
Declaration
Field Value
|
Edit this page
View Source
_linePlaying
Declaration
protected bool _linePlaying
Field Value
|
Edit this page
View Source
dialogueView
Declaration
protected DialogueViewBase dialogueView
Field Value
|
Edit this page
View Source
enginePlugins
Declaration
protected EnginePlugin[] enginePlugins
Field Value
Properties
|
Edit this page
View Source
AudioProvider
The active audio provider. When set and a dialogue line has an "audio"
metadata key, the provider plays the corresponding clip.
Declaration
public IAudioProvider AudioProvider { get; set; }
Property Value
|
Edit this page
View Source
AutoAdvanceDelay
When greater than zero, lines advance automatically after the display
effect finishes plus this delay in seconds. Choices still require
player input. Set to zero to require manual advancement.
Declaration
public float AutoAdvanceDelay { get; set; }
Property Value
|
Edit this page
View Source
ChoiceFilter
Optional filter applied to choices before they are presented.
Receives the full resolved list and returns the filtered list.
Use this to hide, reorder, or modify choices based on game state.
Declaration
public Func<List<Choice>, List<Choice>> ChoiceFilter { get; set; }
Property Value
|
Edit this page
View Source
CurrentLine
The line currently being displayed, or null if no line is active.
Declaration
public Line CurrentLine { get; }
Property Value
|
Edit this page
View Source
CurrentSpeaker
The speaker of the currently displayed line, or null if no line
is active.
Declaration
public string CurrentSpeaker { get; }
Property Value
|
Edit this page
View Source
HasView
True when a dialogue view is assigned. When false, the engine runs
in headless mode: events still fire but no UI is driven.
Declaration
protected bool HasView { get; }
Property Value
|
Edit this page
View Source
History
A read-only log of every line displayed by this engine, in order.
Cleared when a conversation stops unless PersistHistory
is enabled.
Declaration
public IReadOnlyList<Line> History { get; }
Property Value
|
Edit this page
View Source
IsConversationActive
True when a conversation is currently running. False after
StopConversation() or before any conversation starts.
Declaration
public bool IsConversationActive { get; }
Property Value
|
Edit this page
View Source
IsConversationPaused
Declaration
public bool IsConversationPaused { get; }
Property Value
|
Edit this page
View Source
IsLineActive
True while a dialogue line is being displayed (typewriter running,
waiting for player input, etc.). False between lines and when no
conversation is active.
Declaration
public bool IsLineActive { get; }
Property Value
|
Edit this page
View Source
LocalizationProvider
The active localization provider. When set, translated text is used
in place of the original dialogue text. Assign a MonoBehaviour
implementing ILocalizationProvider in the Inspector,
or set this property from code.
Declaration
public ILocalizationProvider LocalizationProvider { get; set; }
Property Value
|
Edit this page
View Source
ParsedConversations
Declaration
public List<Conversation> ParsedConversations { get; protected set; }
Property Value
|
Edit this page
View Source
PersistHistory
When true, the history log is preserved across conversations.
When false (default), it is cleared each time a conversation stops.
Declaration
public bool PersistHistory { get; set; }
Property Value
Methods
|
Edit this page
View Source
Advance()
Convenience method that skips the current display effect if a line is
still playing, or advances to the next line if idle. This is the
recommended single-call handler for player input (click, key press, tap).
Declaration
|
Edit this page
View Source
ClearHistory()
Declaration
public void ClearHistory()
|
Edit this page
View Source
ExportProgress()
Exports a snapshot of the engine's current position within a conversation.
Returns null if no conversation is active. Use alongside
ExportState() and ExportState()
for complete save/load support.
Declaration
public ConversationProgress ExportProgress()
Returns
|
Edit this page
View Source
GetInvocationMethods()
Declaration
protected IEnumerable<DialogueEngineBase.CachedInvocation> GetInvocationMethods()
Returns
|
Edit this page
View Source
InvalidateInvocationCache()
Marks the invocation method cache as dirty, forcing a re-scan on the
next line display. Call this if you add or change assemblies at runtime.
Declaration
public void InvalidateInvocationCache()
|
Edit this page
View Source
InvokeFunctions(List<Invocation>, Line)
Invokes all functions immediately. Used for silent lines where
there is no animated display.
Declaration
protected void InvokeFunctions(List<Invocation> functionInvocations, Line line)
Parameters
|
Edit this page
View Source
JumpTo(string)
Jumps to a conversation by name.
Declaration
public void JumpTo(string conversationName)
Parameters
| Type |
Name |
Description |
| string |
conversationName |
|
|
Edit this page
View Source
Next()
Advances to the next line if the current line is finished and no
choices are active. Does nothing if a line is still playing.
Use Advance() for a single-call handler that also skips.
Declaration
|
Edit this page
View Source
OnDisplayLine(Line)
Called when a dialogue line is ready to be displayed. Override this to
customize how lines are presented, add custom effects, or inject
additional logic between lines.
Text-producing functions (non-void return) fire immediately before
the animation starts. Void functions fire at their character position
during the animated reveal.
Declaration
protected virtual IEnumerator OnDisplayLine(Line line)
Parameters
| Type |
Name |
Description |
| Line |
line |
|
Returns
|
Edit this page
View Source
PauseConversation()
Declaration
public void PauseConversation()
|
Edit this page
View Source
RequestWait(float)
Requests a pause in the display animation for the given duration.
Called by the built-in {{Wait(seconds)}} function.
Declaration
public void RequestWait(float seconds)
Parameters
| Type |
Name |
Description |
| float |
seconds |
|
|
Edit this page
View Source
ResumeConversation()
Declaration
public void ResumeConversation()
|
Edit this page
View Source
ResumeFromProgress(DialogueAsset, ConversationProgress)
Declaration
public void ResumeFromProgress(DialogueAsset asset, ConversationProgress progress)
Parameters
|
Edit this page
View Source
SelectChoice(Choice)
Submits a choice selection programmatically. Use this in headless/event-driven
setups where there is no view handling choice buttons, or when driving
choices from custom UI.
Declaration
public void SelectChoice(Choice choice)
Parameters
| Type |
Name |
Description |
| Choice |
choice |
|
|
Edit this page
View Source
StartConversation(DialogueAsset, int)
Starts a dialogue by parsing the asset and beginning the first (or specified) conversation.
Declaration
public void StartConversation(DialogueAsset interactionDialogue, int startIndex = 0)
Parameters
|
Edit this page
View Source
StopConversation()
Stops the currently playing conversation and clears the dialogue box.
Declaration
public void StopConversation()
|
Edit this page
View Source
SwitchConversation(Conversation)
Switches to a different conversation. Assumes the dialogue file has been parsed.
Declaration
public void SwitchConversation(Conversation conversation)
Parameters