EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Controller.DialogueListener Class Reference

The DialogueListener class defines various methods which are called as certain events occur during dialogue playback. It can be extended in order to easily create new functionality which responds to dialogue events. More...

Inherits MonoBehaviour.

Inherited by EasyTalk.Controller.DialogueController, EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Display.DialoguePanel.

Public Member Functions

virtual void OnContinue ()
 Called whenever the dialogue continues on to the next line.
 
virtual void OnDisplayOptions (List< DialogueOption > options)
 Called whenever dialogue options are to be presented.
 
virtual void OnOptionChosen (DialogueOption option)
 Called whenever an option is chosen from the currently presented list of options.
 
virtual void OnDisplayLine (ConversationLine conversationLine)
 Called when a line of dialogue is to be presented.
 
virtual void OnDialogueEntered (string entryPointName)
 Called whenever a dialogue is entered (when playback begins).
 
virtual void OnDialogueExited (string exitPointName)
 Called whenever a dialogue is exited (when playback ends).
 
virtual void OnExitCompleted ()
 Called at least one frame after a dialogue is exited.
 
virtual void OnStory (string storyText)
 Called whenever a story node is encountered.
 
virtual void OnVariableUpdated (string variableName, object value)
 Called whenever a dialogue variable value is updated.
 
virtual void OnCharacterChanged (string oldCharacterName, string newCharacterName)
 Called whenever a character change is detected.
 
virtual void OnAudioStarted (ConversationLine line)
 Called whenever audio starts playing for a line of dialogue.
 
virtual void OnAudioCompleted (ConversationLine line, bool forceStopped)
 Called whenever audio stops playing for a line of dialogue.
 
virtual void OnActivateKey (string key)
 Called whenever a key tag is present in a line of dialogue.
 
virtual void Wait (float timeInSeconds)
 Called whenever the dialogue encounters a wait node.
 
virtual void OnConversationEnding (ConversationLine line, Node nextNode)
 Called whenever the last line of dialogue in a conversation node is reached.
 
virtual void OnNodeChanged (Node node)
 Called whenever dialogue playback moves to the next node.
 
virtual void OnPause (string signal)
 Called whenever a pause node is reached during dialogue playback.
 

Public Attributes

bool debugEnabled = false
 When set to true, debug logging will be shown for each method called on the listener.
 
UnityEvent onContinue = new UnityEvent()
 An event which is triggered whenever the dialogue continues.
 
UnityEvent onDisplayOptions = new UnityEvent()
 An event which is triggered whenever options are to be displayed to the player.
 
UnityEvent onOptionChosen = new UnityEvent()
 An event which is triggered whenever the player chooses an option.
 
UnityEvent onDisplayLine = new UnityEvent()
 An event which is triggered whenever a line of dialogue is to be displayed.
 
UnityEvent onDialogueEntered = new UnityEvent()
 An event which is triggered whenever dialogue playback begins.
 
UnityEvent onDialogueExited = new UnityEvent()
 An event which is triggered whenever dialogue playback ends.
 
UnityEvent onExitCompleted = new UnityEvent()
 An event which is triggered one frame after dialogue playback ends.
 
UnityEvent onStory = new UnityEvent()
 An event which is triggered whenever a story node is encountered.
 
UnityEvent onVariableUpdated = new UnityEvent()
 An event which is triggered whenever a dialogue variable value is updated.
 
UnityEvent onCharacterChanged = new UnityEvent()
 An event which is triggered whenever a character name change is detected.
 
UnityEvent onAudioStarted = new UnityEvent()
 An event which is triggered whenever dialogue audio starts playing.
 
UnityEvent onAudioCompleted = new UnityEvent()
 An event which is triggered whenever dialogue audio finishes playing.
 
UnityEvent onActivateKey = new UnityEvent()
 An event which is triggered whenever a key is to be processed on a dialogue.
 
UnityEvent onWait = new UnityEvent()
 An event which is triggered whenever a dialogue starts waiting for a certain period of time before continuing.
 
UnityEvent onConversationEnding = new UnityEvent()
 An event which is triggered whenever the last line of dialogue in a conversation node is reached.
 
UnityEvent onNodeChanged = new UnityEvent()
 An event which is triggered whenever a the dialogue flows from one node to another.
 
UnityEvent onPause = new UnityEvent()
 An event which is triggered whenever the dialogue reaches a pause node, pausing and waiting for Continue() to be called.
 

Detailed Description

The DialogueListener class defines various methods which are called as certain events occur during dialogue playback. It can be extended in order to easily create new functionality which responds to dialogue events.

Member Function Documentation

◆ OnActivateKey()

virtual void EasyTalk.Controller.DialogueListener.OnActivateKey ( string key)
virtual

Called whenever a key tag is present in a line of dialogue.

Parameters
keyThe value of the key tag.

Reimplemented in EasyTalk.Display.AbstractDialogueDisplay.

◆ OnAudioCompleted()

virtual void EasyTalk.Controller.DialogueListener.OnAudioCompleted ( ConversationLine line,
bool forceStopped )
virtual

Called whenever audio stops playing for a line of dialogue.

Parameters
lineThe line of dialogue which audio was being played for.
forceStoppedWhether the audio was forced to stop (if false, the audio finished playing).

Reimplemented in EasyTalk.Controller.DialogueController, and EasyTalk.Display.AbstractDialogueDisplay.

◆ OnAudioStarted()

virtual void EasyTalk.Controller.DialogueListener.OnAudioStarted ( ConversationLine line)
virtual

Called whenever audio starts playing for a line of dialogue.

Parameters
lineThe line of dialogue which audio is being played for.

Reimplemented in EasyTalk.Controller.DialogueController, and EasyTalk.Display.AbstractDialogueDisplay.

◆ OnCharacterChanged()

virtual void EasyTalk.Controller.DialogueListener.OnCharacterChanged ( string oldCharacterName,
string newCharacterName )
virtual

Called whenever a character change is detected.

Parameters
oldCharacterNameThe old character name.
newCharacterNameThe new character name.

Reimplemented in EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Display.DialogueDisplay.

◆ OnContinue()

virtual void EasyTalk.Controller.DialogueListener.OnContinue ( )
virtual

Called whenever the dialogue continues on to the next line.

Reimplemented in EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Display.DialogueDisplay.

◆ OnConversationEnding()

virtual void EasyTalk.Controller.DialogueListener.OnConversationEnding ( ConversationLine line,
Node nextNode )
virtual

Called whenever the last line of dialogue in a conversation node is reached.

Parameters
lineThe last line of dialogue in the current conversation node.
nextNodeThe next node after the current conversation node.

Reimplemented in EasyTalk.Controller.DialogueController, EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Display.DialogueDisplay.

◆ OnDialogueEntered()

virtual void EasyTalk.Controller.DialogueListener.OnDialogueEntered ( string entryPointName)
virtual

Called whenever a dialogue is entered (when playback begins).

Parameters
entryPointNameThe name of the entry point ID where dialogue playback is starting.

Reimplemented in EasyTalk.Controller.DialogueController, EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Display.DialogueDisplay.

◆ OnDialogueExited()

virtual void EasyTalk.Controller.DialogueListener.OnDialogueExited ( string exitPointName)
virtual

Called whenever a dialogue is exited (when playback ends).

Parameters
exitPointNameThe name of the exit point ID where dialogue playback finished.

Reimplemented in EasyTalk.Display.AbstractDialogueDisplay, EasyTalk.Controller.DialogueController, and EasyTalk.Display.DialogueDisplay.

◆ OnDisplayLine()

virtual void EasyTalk.Controller.DialogueListener.OnDisplayLine ( ConversationLine conversationLine)
virtual

Called when a line of dialogue is to be presented.

Parameters
conversationLineThe line of dialogue to be displayed.

Reimplemented in EasyTalk.Display.DialogueDisplay, EasyTalk.Controller.DialogueController, and EasyTalk.Display.AbstractDialogueDisplay.

◆ OnDisplayOptions()

virtual void EasyTalk.Controller.DialogueListener.OnDisplayOptions ( List< DialogueOption > options)
virtual

Called whenever dialogue options are to be presented.

Parameters
optionsThe list of dialogue options to present.

Reimplemented in EasyTalk.Controller.DialogueController, EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Display.DialogueDisplay.

◆ OnExitCompleted()

virtual void EasyTalk.Controller.DialogueListener.OnExitCompleted ( )
virtual

Called at least one frame after a dialogue is exited.

Reimplemented in EasyTalk.Display.AbstractDialogueDisplay.

◆ OnNodeChanged()

virtual void EasyTalk.Controller.DialogueListener.OnNodeChanged ( Node node)
virtual

Called whenever dialogue playback moves to the next node.

Parameters
nodeThe new node..

Reimplemented in EasyTalk.Controller.DialogueController, EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Display.DialogueDisplay.

◆ OnOptionChosen()

virtual void EasyTalk.Controller.DialogueListener.OnOptionChosen ( DialogueOption option)
virtual

Called whenever an option is chosen from the currently presented list of options.

Parameters
optionThe dialogue option which was chosen.

Reimplemented in EasyTalk.Display.AbstractDialogueDisplay.

◆ OnPause()

virtual void EasyTalk.Controller.DialogueListener.OnPause ( string signal)
virtual

Called whenever a pause node is reached during dialogue playback.

Parameters
signalThe signal string of the pause node.

Reimplemented in EasyTalk.Controller.DialogueController, and EasyTalk.Display.DialogueDisplay.

◆ OnStory()

virtual void EasyTalk.Controller.DialogueListener.OnStory ( string storyText)
virtual

Called whenever a story node is encountered.

Parameters
storyTextThe text of the story node.

Reimplemented in EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Display.DialogueDisplay.

◆ OnVariableUpdated()

virtual void EasyTalk.Controller.DialogueListener.OnVariableUpdated ( string variableName,
object value )
virtual

Called whenever a dialogue variable value is updated.

Parameters
variableNameThe name of the variable.
valueThe new value of the variable.

Reimplemented in EasyTalk.Display.AbstractDialogueDisplay, and EasyTalk.Controller.DialogueController.

◆ Wait()

virtual void EasyTalk.Controller.DialogueListener.Wait ( float timeInSeconds)
virtual

Called whenever the dialogue encounters a wait node.

Parameters
timeInSecondsThe amount of time which the dialogue will wait before proceeding (in seconds).

Reimplemented in EasyTalk.Controller.DialogueController, and EasyTalk.Display.AbstractDialogueDisplay.

Member Data Documentation

◆ debugEnabled

bool EasyTalk.Controller.DialogueListener.debugEnabled = false

When set to true, debug logging will be shown for each method called on the listener.

◆ onActivateKey

UnityEvent EasyTalk.Controller.DialogueListener.onActivateKey = new UnityEvent()

An event which is triggered whenever a key is to be processed on a dialogue.

◆ onAudioCompleted

UnityEvent EasyTalk.Controller.DialogueListener.onAudioCompleted = new UnityEvent()

An event which is triggered whenever dialogue audio finishes playing.

◆ onAudioStarted

UnityEvent EasyTalk.Controller.DialogueListener.onAudioStarted = new UnityEvent()

An event which is triggered whenever dialogue audio starts playing.

◆ onCharacterChanged

UnityEvent EasyTalk.Controller.DialogueListener.onCharacterChanged = new UnityEvent()

An event which is triggered whenever a character name change is detected.

◆ onContinue

UnityEvent EasyTalk.Controller.DialogueListener.onContinue = new UnityEvent()

An event which is triggered whenever the dialogue continues.

◆ onConversationEnding

UnityEvent EasyTalk.Controller.DialogueListener.onConversationEnding = new UnityEvent()

An event which is triggered whenever the last line of dialogue in a conversation node is reached.

◆ onDialogueEntered

UnityEvent EasyTalk.Controller.DialogueListener.onDialogueEntered = new UnityEvent()

An event which is triggered whenever dialogue playback begins.

◆ onDialogueExited

UnityEvent EasyTalk.Controller.DialogueListener.onDialogueExited = new UnityEvent()

An event which is triggered whenever dialogue playback ends.

◆ onDisplayLine

UnityEvent EasyTalk.Controller.DialogueListener.onDisplayLine = new UnityEvent()

An event which is triggered whenever a line of dialogue is to be displayed.

◆ onDisplayOptions

UnityEvent EasyTalk.Controller.DialogueListener.onDisplayOptions = new UnityEvent()

An event which is triggered whenever options are to be displayed to the player.

◆ onExitCompleted

UnityEvent EasyTalk.Controller.DialogueListener.onExitCompleted = new UnityEvent()

An event which is triggered one frame after dialogue playback ends.

◆ onNodeChanged

UnityEvent EasyTalk.Controller.DialogueListener.onNodeChanged = new UnityEvent()

An event which is triggered whenever a the dialogue flows from one node to another.

◆ onOptionChosen

UnityEvent EasyTalk.Controller.DialogueListener.onOptionChosen = new UnityEvent()

An event which is triggered whenever the player chooses an option.

◆ onPause

UnityEvent EasyTalk.Controller.DialogueListener.onPause = new UnityEvent()

An event which is triggered whenever the dialogue reaches a pause node, pausing and waiting for Continue() to be called.

◆ onStory

UnityEvent EasyTalk.Controller.DialogueListener.onStory = new UnityEvent()

An event which is triggered whenever a story node is encountered.

◆ onVariableUpdated

UnityEvent EasyTalk.Controller.DialogueListener.onVariableUpdated = new UnityEvent()

An event which is triggered whenever a dialogue variable value is updated.

◆ onWait

UnityEvent EasyTalk.Controller.DialogueListener.onWait = new UnityEvent()

An event which is triggered whenever a dialogue starts waiting for a certain period of time before continuing.