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

Controller for managing dialogue flow between a dialogue display and a dialogue node handler. More...

Inherits EasyTalk.Controller.DialogueListener.

Inherited by EasyTalk.Controller.AreaDialogueController, and EasyTalk.Controller.AreaDialogueController2D.

Public Types

enum  PlaybackType { AUTOPLAY , WAIT_FOR_COMMAND }
 Defines dialogue playback types used by dialogue controllers. More...
 

Public Member Functions

void PlayDialogue (string entryPointName=null)
 Starts playback of the dialogue at the specified entry node.
 
void ChangeDialogue (Dialogue dialogue)
 Changes the Dialogue used by the controller.
 
void ExitDialogue ()
 Exits the dialogue playback immediately.
 
override void OnDialogueEntered (string entryPointName)
 Called when dialogue playback begins. This will switch conversation displays used if set to do so and call OnDialogueEntered on all Dialogue Listeners registered with the controller.
 
override void OnDialogueExited (string exitPointName)
 Called when dialogue playback exits. This will stop the autoplay routine and call OnDialogueExited on all registered Dialogue Listeners.
 
override void OnDisplayOptions (List< DialogueOption > options)
 Called whenever options are to be presented. This method filters out options which are set to not be displayed before sending the filtered list on to the OnDisplayOptions method on all registered Dialogue Listeners.
 
override void OnVariableUpdated (string variableName, object variableValue)
 Called whenever a variable value is updated in the dialogue. This method will trigger the OnVariableUpdated method on all registered Dialogue Listeners.
 
override void OnDisplayLine (ConversationLine line)
 Called whenever a line of dialogue is to be displayed. This method does the following:

  • Stops the current autoplay routine if it is running.
  • Switches conversation displays if the controller is set to do so, such as when the character changes or a target tag is specified on the l ine of dialogue.
  • Send a key tag value to any registered Dialogue Listeners via the OnActivateKey method.
  • Starts the autoplay routine or calls the OnDisplayLine method on all registered Dialogue Listeners.
  • Switches the audio to play audio for the new line of dialogue.

 
void SwitchLineAudio (ConversationLine line, ConversationLine previousLine)
 Stops any audio currently playing and starts playing audio for the provided line of dialogue.
 
void CharacterChanged (string newCharacterName)
 Called whenever a character change is detected. If this controller is set to switch conversation displays on character change, it will attempt to do so. Additionally, any Dialogue Listeners registered will have their OnCharacterChanged method triggered.
 
AudioSource GetAudioSource ()
 Finds and returns an audio source on this component or its child components. If the audio source is set on the controller, it will use that audio source instead of searching components for an audio source.
 
bool IsAudioPlaying ()
 Returns whether audio is currently being played by the controller.
 
override void OnConversationEnding (ConversationLine currentLine, Node nextNode)
 Called whenever the last line of dialogue in a conversation node is reached. If the next node is an option node, and options are set to be presented automatically, then the DisplayOptionsAfterDelay coroutine will be started to display options based on the delay settings. THis method also calls OnConversationEnding on all registered Dialogue Listeners.
 
virtual IEnumerator GoToOptionsAfterDelay (float delay, OptionNode optionNode)
 Tells the node handler to jump to the specified option node after a certain period of time.
 
void Continue ()
 Makes the dialogue continue forward from the current point. This method will also trigger the OnContinue method on all registered Dialogue Listeners.
 
override void OnAudioStarted (ConversationLine line)
 Called whenever audio playback starts for a line of dialogue. This will call the OnAudioStarted method of all registered Dialogue Listeners.
 
override void OnAudioCompleted (ConversationLine line, bool forced)
 Called whenever audio playback finishes or is interrupted for a line of dialogue. This will call the OnAudioCompleted method of all registered Dialogue Listeners.
 
override void OnNodeChanged (Node newNode)
 Called whenever the current node being processed changes.
 
void ChooseOption (DialogueOption option)
 Chooses the specified option and calls the OnOptionChosen method of all registered Dialogue Listeners.
 
override void Wait (float timeInSeconds)
 Creates a coroutine to wait for the specified duration before continuing. This method also calls the Wait method on all registered Dialogue Listeners.
 
override void OnPause (string signal)
 Called whenever a pause node is reached during dialogue playback.
Parameters
signalThe signal string of the pause node.

 
NodeHandler GetNodeHandler ()
 Returns the node handler used by this controller.
 
ConversationDisplay GetConversationDisplay ()
 Returns the conversation display to use when entering dialogue playback via this controller.
 
string GetConversationDisplayID ()
 Returns the Display ID of the conversation display to use when entering dialogue playback via this controller.
 
void SetStringVariable (string variableName, string value)
 Sets the value of the specified variable.
 
string GetStringVariable (string variableName)
 Returns the string value of the specified variable.
 
void SetBoolVariable (string variableName, bool value)
 Sets the value of the specified variable.
 
bool GetBoolVariable (string variableName)
 Returns the bool value of the specified variable.
 
void SetIntVariable (string variableName, int value)
 Sets the value of the specified variable.
 
int GetIntVariable (string variableName)
 Returns the int value of the specified variable.
 
void SetFloatVariable (string variableName, float value)
 Sets the value of the specified variable.
 
float GetFloatVariable (string variableName)
 Returns the float value of the specified variable.
 
void AddDialogueListener (DialogueListener dialogueListener)
 Adds the specified Dialogue Listener to the controller's list of listeners.
 
void RemoveDialogueListener (DialogueListener dialogueListener)
 Removes the specified Dialogue Listener from the controller's list of listeners.
 
void RemoveDialogueListeners ()
 Removes all Dialogue Listeners from the controller.
 
PlaybackType GetPlaybackType ()
 Gets the playback type of this controller.
 
void SetPlaybackType (PlaybackType playbackType)
 Sets the playback type of this controller.
 
void SaveVariableValues (string prefix="", bool saveToPlayerPrefs=false)
 Saves the values of all variables in the Dialogue to either a file, or to the PlayerPrefs.
 
void LoadVariableValues (string prefix="", bool loadFromPlayerPrefs=false)
 Loads the states of the Dialogue's variables from a save if available.
 
- Public Member Functions inherited from EasyTalk.Controller.DialogueListener
virtual void OnContinue ()
 Called whenever the dialogue continues on to the next line.
 
virtual void OnOptionChosen (DialogueOption option)
 Called whenever an option is chosen from the currently presented list of options.
 
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 OnCharacterChanged (string oldCharacterName, string newCharacterName)
 Called whenever a character change is detected.
 
virtual void OnActivateKey (string key)
 Called whenever a key tag is present in a line of dialogue.
 

Public Attributes

UnityEvent onPlay = new UnityEvent()
 An event which is triggered when dialogue playback starts.
 
UnityEvent onStop = new UnityEvent()
 An event which is triggered when dialogue playback stops.
 
- Public Attributes inherited from EasyTalk.Controller.DialogueListener
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.
 

Protected Member Functions

virtual void Init ()
 Initializes the controller to prepare it for playing dialogue.
 
virtual void ActivateKey (ConversationLine line)
 Activates the key of the specified line of dialogue by sending its key value to all registered Dialogue Listeners by calling their OnActivateKey methods.
 
IEnumerator PlayAudioClip (ConversationLine line)
 Plays the audio clip for the specified line of dialogue.
 

Protected Attributes

Dialogue dialogue
 The Dialogue to use.
 
PlaybackType playbackType
 The playback type of the controller.
 
AbstractDialogueDisplay dialogueDisplay
 The dialogue display currently being used by this controller.
 
ConversationDisplay conversationDisplay = null
 The converstion display to use when playing dialogue.
 
string conversationDisplayID = null
 The ID of the conversation display to use when initializing a conversation on a dialogue display and no conversation display is set.
 
AudioSource audioSource
 The audio source to use for playing lines of dialogue.
 
List< DialogueListenerdialogueListeners = new List<DialogueListener>()
 A collection of DialogueListeners to call as dialogue playback occurs.
 
bool isRunning = false
 Whether the dialogue is currently being played.
 

Properties

AbstractDialogueDisplay DialogueDisplay [get, set]
 Gets or sets the Dialogue Display currently used by this controller.
 
Dialogue CurrentDialogue [get]
 Gets the Dialogue currently set on the dialogue controller.
 

Private Member Functions

void Awake ()
 
AbstractDialogueDisplay FindDialogueDisplay ()
 Finds a dialogue display to use.
 
IEnumerator ExitCompleted ()
 Called at the end of OnDialogueExited(). Waits for one frame and then calls OnExitCompleted on this controller and all registered dialogue listeners.
 
IEnumerator WaitAsync (float timeInSeconds)
 Waits for the specified duration before continuing.
 
void SetVariableValue (string variableName, object value, Type valueType)
 Sets the value of the specified variable.
 
object GetVariableValue (string variableName, Type variableType)
 Returns the value of the specified variable.
 

Private Attributes

NodeHandler nodeHandler
 The node handler used to process the Dialogue.
 
bool useDialogueDisplay = true
 Determines whether the controller will attempt to register and use a Dialogue Display automatically.
 
Coroutine audioRoutine = null
 A coroutine for playing audio for a line of dialogue.
 
bool sendNullKeys = true
 Whetehr null keys should be sent when no key exists on a line of dialogue.
 
bool isAudioPlaying = false
 A flag to keep track of whether audio is currently playing.
 
string currentCharacterName = null
 The name of the character which dialogue is currently being shown for.
 

Detailed Description

Controller for managing dialogue flow between a dialogue display and a dialogue node handler.

Member Enumeration Documentation

◆ PlaybackType

Defines dialogue playback types used by dialogue controllers.

Enumerator
AUTOPLAY 
WAIT_FOR_COMMAND 

Member Function Documentation

◆ ActivateKey()

virtual void EasyTalk.Controller.DialogueController.ActivateKey ( ConversationLine line)
protectedvirtual

Activates the key of the specified line of dialogue by sending its key value to all registered Dialogue Listeners by calling their OnActivateKey methods.

Parameters
lineThe line of dialogue to activate the key of.

◆ AddDialogueListener()

void EasyTalk.Controller.DialogueController.AddDialogueListener ( DialogueListener dialogueListener)

Adds the specified Dialogue Listener to the controller's list of listeners.

Parameters
dialogueListenerThe Dialogue Listener to add.

◆ Awake()

void EasyTalk.Controller.DialogueController.Awake ( )
private

◆ ChangeDialogue()

void EasyTalk.Controller.DialogueController.ChangeDialogue ( Dialogue dialogue)

Changes the Dialogue used by the controller.

Parameters
dialogueThe Dialogue to use.

◆ CharacterChanged()

void EasyTalk.Controller.DialogueController.CharacterChanged ( string newCharacterName)

Called whenever a character change is detected. If this controller is set to switch conversation displays on character change, it will attempt to do so. Additionally, any Dialogue Listeners registered will have their OnCharacterChanged method triggered.

Parameters
newCharacterNameThe name of the character being switched to.

◆ ChooseOption()

void EasyTalk.Controller.DialogueController.ChooseOption ( DialogueOption option)

Chooses the specified option and calls the OnOptionChosen method of all registered Dialogue Listeners.

Parameters
optionThe option to choose.

◆ Continue()

void EasyTalk.Controller.DialogueController.Continue ( )

Makes the dialogue continue forward from the current point. This method will also trigger the OnContinue method on all registered Dialogue Listeners.

Note that a continuation is only allowed when the current node is a converation, story, or wait node.

◆ ExitCompleted()

IEnumerator EasyTalk.Controller.DialogueController.ExitCompleted ( )
private

Called at the end of OnDialogueExited(). Waits for one frame and then calls OnExitCompleted on this controller and all registered dialogue listeners.

Returns

◆ ExitDialogue()

void EasyTalk.Controller.DialogueController.ExitDialogue ( )

Exits the dialogue playback immediately.

◆ FindDialogueDisplay()

AbstractDialogueDisplay EasyTalk.Controller.DialogueController.FindDialogueDisplay ( )
private

Finds a dialogue display to use.

◆ GetAudioSource()

AudioSource EasyTalk.Controller.DialogueController.GetAudioSource ( )

Finds and returns an audio source on this component or its child components. If the audio source is set on the controller, it will use that audio source instead of searching components for an audio source.

Returns
An AudioSource on this GameObject or from its children if none exists on this GameObject.

◆ GetBoolVariable()

bool EasyTalk.Controller.DialogueController.GetBoolVariable ( string variableName)

Returns the bool value of the specified variable.

Parameters
variableNameThe name of the variable to retrieve the value of.
Returns
The bool value of the specified variable.

◆ GetConversationDisplay()

ConversationDisplay EasyTalk.Controller.DialogueController.GetConversationDisplay ( )

Returns the conversation display to use when entering dialogue playback via this controller.

Returns
The conversation display to use.

◆ GetConversationDisplayID()

string EasyTalk.Controller.DialogueController.GetConversationDisplayID ( )

Returns the Display ID of the conversation display to use when entering dialogue playback via this controller.

Returns

◆ GetFloatVariable()

float EasyTalk.Controller.DialogueController.GetFloatVariable ( string variableName)

Returns the float value of the specified variable.

Parameters
variableNameThe name of the variable to retrieve the value of.
Returns
The float value of the specified variable.

◆ GetIntVariable()

int EasyTalk.Controller.DialogueController.GetIntVariable ( string variableName)

Returns the int value of the specified variable.

Parameters
variableNameThe name of the variable to retrieve the value of.
Returns
The int value of the specified variable.

◆ GetNodeHandler()

NodeHandler EasyTalk.Controller.DialogueController.GetNodeHandler ( )

Returns the node handler used by this controller.

Returns
The node handler being used.

◆ GetPlaybackType()

PlaybackType EasyTalk.Controller.DialogueController.GetPlaybackType ( )

Gets the playback type of this controller.

Returns
The playback type.

◆ GetStringVariable()

string EasyTalk.Controller.DialogueController.GetStringVariable ( string variableName)

Returns the string value of the specified variable.

Parameters
variableNameThe name of the variable to retrieve the value of.
Returns
The string value of the specified variable.

◆ GetVariableValue()

object EasyTalk.Controller.DialogueController.GetVariableValue ( string variableName,
Type variableType )
private

Returns the value of the specified variable.

Parameters
variableNameThe name of the variable.
variableTypeThe variable type.
Returns
The value of the specified variable.
Exceptions
Exception

◆ GoToOptionsAfterDelay()

virtual IEnumerator EasyTalk.Controller.DialogueController.GoToOptionsAfterDelay ( float delay,
OptionNode optionNode )
virtual

Tells the node handler to jump to the specified option node after a certain period of time.

Parameters
delayThe delay, in seconds.
optionNodeThe option node to go to.
Returns

◆ Init()

virtual void EasyTalk.Controller.DialogueController.Init ( )
protectedvirtual

Initializes the controller to prepare it for playing dialogue.

◆ IsAudioPlaying()

bool EasyTalk.Controller.DialogueController.IsAudioPlaying ( )

Returns whether audio is currently being played by the controller.

Returns
Whether audio is currently being played by the controller.

◆ LoadVariableValues()

void EasyTalk.Controller.DialogueController.LoadVariableValues ( string prefix = "",
bool loadFromPlayerPrefs = false )

Loads the states of the Dialogue's variables from a save if available.

Parameters
prefixThe prefix to use when loading. This prefix is appended to the beginning of the dialogue name.
loadFromPlayerPrefsIf true, variable states will be loaded from PlayerPrefs rather than a JSON file.

◆ OnAudioCompleted()

override void EasyTalk.Controller.DialogueController.OnAudioCompleted ( ConversationLine line,
bool forced )
virtual

Called whenever audio playback finishes or is interrupted for a line of dialogue. This will call the OnAudioCompleted method of all registered Dialogue Listeners.

Parameters
lineThe line of dialogue which audio ended for.
forcedWhether the audio was forcibly interrupted.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnAudioStarted()

override void EasyTalk.Controller.DialogueController.OnAudioStarted ( ConversationLine line)
virtual

Called whenever audio playback starts for a line of dialogue. This will call the OnAudioStarted method of all registered Dialogue Listeners.

Parameters
lineThe line of dialogue audio started for.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnConversationEnding()

override void EasyTalk.Controller.DialogueController.OnConversationEnding ( ConversationLine currentLine,
Node nextNode )
virtual

Called whenever the last line of dialogue in a conversation node is reached. If the next node is an option node, and options are set to be presented automatically, then the DisplayOptionsAfterDelay coroutine will be started to display options based on the delay settings. THis method also calls OnConversationEnding on all registered Dialogue Listeners.

Parameters
currentLineThe current line of dialogue being displayed.
nextNodeThe next node to move to after the current conversation node.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnDialogueEntered()

override void EasyTalk.Controller.DialogueController.OnDialogueEntered ( string entryPointName)
virtual

Called when dialogue playback begins. This will switch conversation displays used if set to do so and call OnDialogueEntered on all Dialogue Listeners registered with the controller.

Parameters
entryPointNameThe name of the entry point where the Dialogue playback began.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnDialogueExited()

override void EasyTalk.Controller.DialogueController.OnDialogueExited ( string exitPointName)
virtual

Called when dialogue playback exits. This will stop the autoplay routine and call OnDialogueExited on all registered Dialogue Listeners.

Parameters
exitPointNameThe name of the exit point where the dialogue exited.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnDisplayLine()

override void EasyTalk.Controller.DialogueController.OnDisplayLine ( ConversationLine line)
virtual

Called whenever a line of dialogue is to be displayed. This method does the following:

  • Stops the current autoplay routine if it is running.
  • Switches conversation displays if the controller is set to do so, such as when the character changes or a target tag is specified on the l ine of dialogue.
  • Send a key tag value to any registered Dialogue Listeners via the OnActivateKey method.
  • Starts the autoplay routine or calls the OnDisplayLine method on all registered Dialogue Listeners.
  • Switches the audio to play audio for the new line of dialogue.

Parameters
lineThe line of dialogue to display.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnDisplayOptions()

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

Called whenever options are to be presented. This method filters out options which are set to not be displayed before sending the filtered list on to the OnDisplayOptions method on all registered Dialogue Listeners.

Parameters
optionsThe list of dialogue options to present.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnNodeChanged()

override void EasyTalk.Controller.DialogueController.OnNodeChanged ( Node newNode)
virtual

Called whenever the current node being processed changes.

Parameters
newNodeThe new node.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnPause()

override void EasyTalk.Controller.DialogueController.OnPause ( string signal)
virtual

Called whenever a pause node is reached during dialogue playback.

Parameters
signalThe signal string of the pause node.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ OnVariableUpdated()

override void EasyTalk.Controller.DialogueController.OnVariableUpdated ( string variableName,
object variableValue )
virtual

Called whenever a variable value is updated in the dialogue. This method will trigger the OnVariableUpdated method on all registered Dialogue Listeners.

Parameters
variableNameThe name of the variable which was updated.
variableValueThe new value of the variable.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ PlayAudioClip()

IEnumerator EasyTalk.Controller.DialogueController.PlayAudioClip ( ConversationLine line)
protected

Plays the audio clip for the specified line of dialogue.

Parameters
lineThe line of dialogue to play audio for.
Returns

◆ PlayDialogue()

void EasyTalk.Controller.DialogueController.PlayDialogue ( string entryPointName = null)

Starts playback of the dialogue at the specified entry node.

Parameters
entryPointNameThe name of the entry point ID where the dialogue should start from.

◆ RemoveDialogueListener()

void EasyTalk.Controller.DialogueController.RemoveDialogueListener ( DialogueListener dialogueListener)

Removes the specified Dialogue Listener from the controller's list of listeners.

Parameters
dialogueListenerThe Dialogue Listener to remove.

◆ RemoveDialogueListeners()

void EasyTalk.Controller.DialogueController.RemoveDialogueListeners ( )

Removes all Dialogue Listeners from the controller.

◆ SaveVariableValues()

void EasyTalk.Controller.DialogueController.SaveVariableValues ( string prefix = "",
bool saveToPlayerPrefs = false )

Saves the values of all variables in the Dialogue to either a file, or to the PlayerPrefs.

Parameters
prefixThe prefix to use when saving. This prefix is appended to the beginning of the dialogue name.
saveToPlayerPrefsWhether the variable states should be saved to PlayerPrefs. If set to false, the variable states will be saved to a JSON file instead.

◆ SetBoolVariable()

void EasyTalk.Controller.DialogueController.SetBoolVariable ( string variableName,
bool value )

Sets the value of the specified variable.

Parameters
variableNameThe name of the variable.
valueThe value to set.

◆ SetFloatVariable()

void EasyTalk.Controller.DialogueController.SetFloatVariable ( string variableName,
float value )

Sets the value of the specified variable.

Parameters
variableNameThe name of the variable.
valueThe value to set.

◆ SetIntVariable()

void EasyTalk.Controller.DialogueController.SetIntVariable ( string variableName,
int value )

Sets the value of the specified variable.

Parameters
variableNameThe name of the variable.
valueThe value to set.

◆ SetPlaybackType()

void EasyTalk.Controller.DialogueController.SetPlaybackType ( PlaybackType playbackType)

Sets the playback type of this controller.

Parameters
playbackTypeThe playback type to use.

◆ SetStringVariable()

void EasyTalk.Controller.DialogueController.SetStringVariable ( string variableName,
string value )

Sets the value of the specified variable.

Parameters
variableNameThe name of the variable.
valueThe value to set.

◆ SetVariableValue()

void EasyTalk.Controller.DialogueController.SetVariableValue ( string variableName,
object value,
Type valueType )
private

Sets the value of the specified variable.

Parameters
variableNameThe name of the variable.
valueThe value to set.
valueTypeThe type of the variable.
Exceptions
Exception

◆ SwitchLineAudio()

void EasyTalk.Controller.DialogueController.SwitchLineAudio ( ConversationLine line,
ConversationLine previousLine )

Stops any audio currently playing and starts playing audio for the provided line of dialogue.

Parameters
lineThe line of dialogue to play audio for.
previousLineThe line of dialogue which was last displayed.

◆ Wait()

override void EasyTalk.Controller.DialogueController.Wait ( float timeInSeconds)
virtual

Creates a coroutine to wait for the specified duration before continuing. This method also calls the Wait method on all registered Dialogue Listeners.

Parameters
timeInSecondsThe amount of time to wait, in seconds.

Reimplemented from EasyTalk.Controller.DialogueListener.

◆ WaitAsync()

IEnumerator EasyTalk.Controller.DialogueController.WaitAsync ( float timeInSeconds)
private

Waits for the specified duration before continuing.

Parameters
timeInSecondsThe amount of time to wait, in seconds.
Returns

Member Data Documentation

◆ audioRoutine

Coroutine EasyTalk.Controller.DialogueController.audioRoutine = null
private

A coroutine for playing audio for a line of dialogue.

◆ audioSource

AudioSource EasyTalk.Controller.DialogueController.audioSource
protected

The audio source to use for playing lines of dialogue.

◆ conversationDisplay

ConversationDisplay EasyTalk.Controller.DialogueController.conversationDisplay = null
protected

The converstion display to use when playing dialogue.

◆ conversationDisplayID

string EasyTalk.Controller.DialogueController.conversationDisplayID = null
protected

The ID of the conversation display to use when initializing a conversation on a dialogue display and no conversation display is set.

◆ currentCharacterName

string EasyTalk.Controller.DialogueController.currentCharacterName = null
private

The name of the character which dialogue is currently being shown for.

◆ dialogue

Dialogue EasyTalk.Controller.DialogueController.dialogue
protected

The Dialogue to use.

◆ dialogueDisplay

AbstractDialogueDisplay EasyTalk.Controller.DialogueController.dialogueDisplay
protected

The dialogue display currently being used by this controller.

◆ dialogueListeners

List<DialogueListener> EasyTalk.Controller.DialogueController.dialogueListeners = new List<DialogueListener>()
protected

A collection of DialogueListeners to call as dialogue playback occurs.

◆ isAudioPlaying

bool EasyTalk.Controller.DialogueController.isAudioPlaying = false
private

A flag to keep track of whether audio is currently playing.

◆ isRunning

bool EasyTalk.Controller.DialogueController.isRunning = false
protected

Whether the dialogue is currently being played.

◆ nodeHandler

NodeHandler EasyTalk.Controller.DialogueController.nodeHandler
private

The node handler used to process the Dialogue.

◆ onPlay

UnityEvent EasyTalk.Controller.DialogueController.onPlay = new UnityEvent()

An event which is triggered when dialogue playback starts.

◆ onStop

UnityEvent EasyTalk.Controller.DialogueController.onStop = new UnityEvent()

An event which is triggered when dialogue playback stops.

◆ playbackType

PlaybackType EasyTalk.Controller.DialogueController.playbackType
protected

The playback type of the controller.

◆ sendNullKeys

bool EasyTalk.Controller.DialogueController.sendNullKeys = true
private

Whetehr null keys should be sent when no key exists on a line of dialogue.

◆ useDialogueDisplay

bool EasyTalk.Controller.DialogueController.useDialogueDisplay = true
private

Determines whether the controller will attempt to register and use a Dialogue Display automatically.

Property Documentation

◆ CurrentDialogue

Dialogue EasyTalk.Controller.DialogueController.CurrentDialogue
get

Gets the Dialogue currently set on the dialogue controller.

◆ DialogueDisplay

AbstractDialogueDisplay EasyTalk.Controller.DialogueController.DialogueDisplay
getset

Gets or sets the Dialogue Display currently used by this controller.