|
EasyTalk API
|
This class is an abstract framework laying the foundation for a Dialogue Display. More...
Inherits EasyTalk.Controller.DialogueListener.
Inherited by EasyTalk.Display.DialogueDisplay.
Classes | |
| class | TextFontSettings |
| Internal class used to keep track of font and font size settings for standard text components used by a dialogue display. More... | |
Public Member Functions | |||||
| virtual void | Continue () | ||||
| If continuation is currently permitted, this will call the dialogue controller's Continue() method to continue to the next part of the current converstaion and disable continuation. | |||||
| bool | SelectNextOption () | ||||
| Selects the next option in the option display (only applicable when options are being presented). | |||||
| bool | SelectPreviousOption () | ||||
| Selects the previous option in the option display (only applicable when options are being presented). | |||||
| void | ChooseSelectedOption () | ||||
| Chooses the selected option. This method should notify the Dialogue Controller of the option that was chosen using DialogueOption.OptionIndex. | |||||
| bool | SelectOptionInDirection (Vector2 direction) | ||||
| Selects the option which most closely corresponds to the specified direction. | |||||
| virtual void | ExitDialogue () | ||||
| This method tells the active dialogue controller to exit the dialogue immediately. | |||||
| void | SetActiveDialogueController (DialogueController dialogueController) | ||||
| Set the active dialogue controller for the dialogue display to communicate with. | |||||
| override void | OnDisplayOptions (List< DialogueOption > options) | ||||
| This method is called when options are displayed and sets the IsCurrentlyInConversation flag to false. | |||||
| override void | OnDisplayLine (ConversationLine line) | ||||
| This method is called when a line of dialogue is being displayed and sets the IsCurrentlyInConversation flag to true. | |||||
| override void | OnDialogueExited (string exitName) | ||||
| This method is called when the dialogue exits playback and sets the IsCurrentlyInConversation flag to false;. | |||||
| override void | OnExitCompleted () | ||||
| Called at least one frame after a dialogue is exited. | |||||
| ConversationDisplay | GetConversationDisplay () | ||||
| Returns the conversation display being used by this dialogue display. | |||||
| void | SetConversationDisplay (ConversationDisplay convoDisplay) | ||||
| Sets the conversation display used by the dialogue display. | |||||
| OptionDisplay | GetOptionDisplay () | ||||
| Returns the option display being used by this dialogue display. | |||||
| void | SetOptionDisplay (OptionDisplay optionDisplay) | ||||
| Sets the option display being used by this dialogue display. | |||||
| ContinueDisplay | GetContinueDisplay () | ||||
| Returns the continue display being used by this dialogue display. | |||||
| void | SetContinueDisplay (ContinueDisplay continueDisplaY) | ||||
| Sets the continue display used by this dialogue display. | |||||
| TextInputDisplay | GetTextInputDisplay () | ||||
| Gets the TextInputDisplay used to retrieve text input from the player. | |||||
| void | SetTextInputDisplay (TextInputDisplay textInputDisplay) | ||||
| Sets the TextInputDisplay used to retrieve text input from the player. | |||||
| virtual void | AllowContinue () | ||||
| Allows the current conversation to be continued. | |||||
| virtual void | DisableContinue () | ||||
| Disallows continuation of the current conversation. | |||||
| void | AllowOptionSelection () | ||||
| Allows option selection. | |||||
| void | DisableOptionSelection () | ||||
| Disallows option selection. | |||||
| override void | OnContinue () | ||||
| This method is called when a continue occurs. | |||||
| void | SetLanguage (string languageCode) | ||||
| Sets the language used by the dialogue display. | |||||
| void | AddDialogueListener (DialogueListener dialogueListener) | ||||
| Adds the specified Dialogue Listener to the list of listeners. | |||||
| void | RemoveDialogueListener (DialogueListener dialogueListener) | ||||
| Removes the specified Dialogue Listener from the list of listeners. | |||||
| void | RemoveDialogueListeners () | ||||
| Removes all Dialogue Listeners of the display. | |||||
| override void | OnOptionChosen (DialogueOption option) | ||||
Called whenever an option is chosen from the currently presented list of options.
| |||||
| override void | OnDialogueEntered (string entryPointName) | ||||
Called whenever a dialogue is entered (when playback begins).
| |||||
| override void | OnStory (string storyText) | ||||
Called whenever a story node is encountered.
| |||||
| override void | OnVariableUpdated (string variableName, object value) | ||||
Called whenever a dialogue variable value is updated.
| |||||
| override void | OnCharacterChanged (string oldCharacterName, string newCharacterName) | ||||
Called whenever a character change is detected.
| |||||
| override void | OnAudioStarted (ConversationLine line) | ||||
Called whenever audio starts playing for a line of dialogue.
| |||||
| override void | OnAudioCompleted (ConversationLine line, bool forceStopped) | ||||
Called whenever audio stops playing for a line of dialogue.
| |||||
| override void | OnActivateKey (string key) | ||||
Called whenever a key tag is present in a line of dialogue.
| |||||
| override void | Wait (float timeInSeconds) | ||||
Called whenever the dialogue encounters a wait node.
| |||||
| override void | OnConversationEnding (ConversationLine line, Node nextNode) | ||||
Called whenever the last line of dialogue in a conversation node is reached.
| |||||
| override void | OnNodeChanged (Node node) | ||||
Called whenever dialogue playback moves to the next node.
| |||||
| override void | OnPause (string signal) | ||||
Called whenever a pause node is reached during dialogue playback.
| |||||
| override void | OnExecuteAsyncNode (AsyncNode node) | ||||
Called whenever an async node is encountered and needs some external class to handle its execution.
| |||||
| override void | OnAppendText (string text) | ||||
Called whenever text is to be appended to the current dialogue's conversation text.
| |||||
| override void | OnWaitingForNodeEvaluation (Node asyncNode) | ||||
Called just before an asynchronous node is executed to notify listeners that the dialogue is about to enter a waiting state.
| |||||
| override void | OnNodeEvaluationCompleted (Node asyncNode) | ||||
Called whenever an asynchronous node's evaluation/execution has been commpleted.
| |||||
Public Attributes | |
| UnityEvent | onContinueEnabled |
| A Unity Event which is triggered whenever continuation of the current dialogue is allowed. | |
| UnityEvent | onContinueDisabled |
| A Unity Event which is triggered whenever continuation of the current dialogue is disabled. | |
| UnityEvent | onOptionSelectionEnabled |
| A Unity Event which is triggered whenever option selection is enabled (after options are presented). | |
| UnityEvent | onOptionSelectionDisabled |
| A Unity Event which is triggered whenever option selection is disabled (after an option is chosen). | |
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. | |
| UnityEvent | onExecuteAsyncNode = new UnityEvent() |
| An event which is triggered whenever an asynchronous node must be processed. | |
| UnityEvent | onAppendText = new UnityEvent() |
| UnityEvent | onWaitingForNodeCompletion = new UnityEvent() |
| UnityEvent | onNodeEvaluationCompleted = new UnityEvent() |
Protected Member Functions | |
| virtual void | Init () |
| If using the new input system, Init() sets up the input actions. This method also registers a method with the onLanguageChanged delegate so that the dialogue display can update fonts of all child components whenever the language is changed. | |
| void | LanguageChanged (string oldLanguage, string newLanguage) |
| This method is called whenever the language is changed by setting the language on the EasyTalkGameState. | |
| void | TranslateComponents () |
| Translates the text set on the conversation display and option display based on the currently set language of EasyTalkGameState.Instance. | |
| void | UpdateFontsForLanguage (Component component) |
| Updates all of the fonts on child text components based on the language currently being used. | |
Protected Attributes | |
| EasyTalkDialogueSettings | dialogueSettings |
| The EasyTalk dialogue settings to use. | |
| DialogueController | dialogueController |
| The currently active dialogue controller. | |
| bool | destroyOnLoad = false |
| When true, the dialogue display will be destroyed when a new scene is loaded. | |
| List< DialogueListener > | dialogueListeners = new List<DialogueListener>() |
| A collection of Dialogue Listeners to call as dialogue playback occurs. | |
Static Protected Attributes | |
| static AbstractDialogueDisplay | instance |
| An instance of a Dialogue Display. | |
Properties | |
| bool | IsPlaying = false [get, private set] |
| A flag indicating whether the display is currently playing a dialogue. | |
| bool | IsCurrentlyInConversation = false [get, protected set] |
| A flag indicating whether the dialogue is currently displaying a conversation (rather than options). | |
| static AbstractDialogueDisplay | Instance [get] |
| Gets the dialogue display instance. | |
| DialogueController | CurrentController [get] |
| Returns the current DialogueController being used by this dialogue display, if there is one. | |
| bool | IsOptionSelectionAllowed [get, set] |
| Gets or sets whether the dialogue is currently allowing options to be selected by the player. | |
| bool | IsQuickExitAllowed [get, set] |
| Gets or sets whether the player is allowed to immediately exit the dialogue by pressing a button. | |
| bool | IsContinueAllowed [get, set] |
| Gets or sets whether continuation is allowed by the player by pressing a button. | |
| EasyTalkDialogueSettings | DialogueSettings [get, set] |
| Gets or sets the EasyTalk Dialogue Settings used by the display. | |
Private Member Functions | |
| void | Awake () |
| void | OnValidate () |
| Enables and disables Unity standard Text components and TextMeshPro components based on whether TextMeshPro is enabled/installed. | |
| void | OnDestroy () |
| Unregister the LanguageChanged method frm the onLanguageChanged delegate so that the EasyTalkGameState instance will no longer try to call this object. | |
Private Attributes | |
| bool | allowQuickExit |
| When set to true, the dialogue display allows an immediate exit from the currently running dialogue. | |
| bool | isContinueAllowed = false |
| A flag indicating whether continuation is currently permitted in the conversation. | |
| bool | isOptionSelectionAllowed = false |
| A flag indicating whether option selection is currently permitted. | |
This class is an abstract framework laying the foundation for a Dialogue Display.
| void EasyTalk.Display.AbstractDialogueDisplay.AddDialogueListener | ( | DialogueListener | dialogueListener | ) |
Adds the specified Dialogue Listener to the list of listeners.
| dialogueListener | The Dialogue Listener to add. |
|
virtual |
Allows the current conversation to be continued.
Reimplemented in EasyTalk.Display.DialogueDisplay.
| void EasyTalk.Display.AbstractDialogueDisplay.AllowOptionSelection | ( | ) |
Allows option selection.
|
private |
|
abstract |
Chooses the selected option. This method should notify the Dialogue Controller of the option that was chosen using DialogueOption.OptionIndex.
|
virtual |
If continuation is currently permitted, this will call the dialogue controller's Continue() method to continue to the next part of the current converstaion and disable continuation.
|
virtual |
Disallows continuation of the current conversation.
Reimplemented in EasyTalk.Display.DialogueDisplay.
| void EasyTalk.Display.AbstractDialogueDisplay.DisableOptionSelection | ( | ) |
Disallows option selection.
|
virtual |
This method tells the active dialogue controller to exit the dialogue immediately.
|
abstract |
Returns the continue display being used by this dialogue display.
|
abstract |
Returns the conversation display being used by this dialogue display.
|
abstract |
Returns the option display being used by this dialogue display.
|
abstract |
Gets the TextInputDisplay used to retrieve text input from the player.
|
protectedvirtual |
If using the new input system, Init() sets up the input actions. This method also registers a method with the onLanguageChanged delegate so that the dialogue display can update fonts of all child components whenever the language is changed.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
protected |
This method is called whenever the language is changed by setting the language on the EasyTalkGameState.
| oldLanguage | The previous ISO-639 language code being used. |
| newLanguage | The new ISO-639 language code to use. |
|
virtual |
Called whenever a key tag is present in a line of dialogue.
| key | The value of the key tag. |
Reimplemented from EasyTalk.Controller.DialogueListener.
|
virtual |
Called whenever text is to be appended to the current dialogue's conversation text.
| text | The text to append. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
Called whenever audio stops playing for a line of dialogue.
| line | The line of dialogue which audio was being played for. |
| forceStopped | Whether the audio was forced to stop (if false, the audio finished playing). |
Reimplemented from EasyTalk.Controller.DialogueListener.
|
virtual |
Called whenever audio starts playing for a line of dialogue.
| line | The line of dialogue which audio is being played for. |
Reimplemented from EasyTalk.Controller.DialogueListener.
|
virtual |
Called whenever a character change is detected.
| oldCharacterName | The old character name. |
| newCharacterName | The new character name. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
This method is called when a continue occurs.
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
Called whenever the last line of dialogue in a conversation node is reached.
| line | The last line of dialogue in the current conversation node. |
| nextNode | The next node after the current conversation node. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
private |
Unregister the LanguageChanged method frm the onLanguageChanged delegate so that the EasyTalkGameState instance will no longer try to call this object.
|
virtual |
Called whenever a dialogue is entered (when playback begins).
| entryPointName | The name of the entry point ID where dialogue playback is starting. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
This method is called when the dialogue exits playback and sets the IsCurrentlyInConversation flag to false;.
| exitName | The name of the exit point where the dialogue exited. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
This method is called when a line of dialogue is being displayed and sets the IsCurrentlyInConversation flag to true.
| line | The line of dialogue being displayed. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
This method is called when options are displayed and sets the IsCurrentlyInConversation flag to false.
| options | The List of dialogue options being displayed. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
Called whenever an async node is encountered and needs some external class to handle its execution.
| node | The asynchronous node to process. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
Called at least one frame after a dialogue is exited.
Reimplemented from EasyTalk.Controller.DialogueListener.
|
virtual |
Called whenever dialogue playback moves to the next node.
| node | The new node.. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
Called whenever an asynchronous node's evaluation/execution has been commpleted.
| asyncNode | The asynchronous node which was executed. |
Reimplemented from EasyTalk.Controller.DialogueListener.
|
virtual |
Called whenever an option is chosen from the currently presented list of options.
| option | The dialogue option which was chosen. |
Reimplemented from EasyTalk.Controller.DialogueListener.
|
virtual |
Called whenever a pause node is reached during dialogue playback.
| signal | The signal string of the pause node. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
virtual |
Called whenever a story node is encountered.
| storyText | The text of the story node. |
Reimplemented from EasyTalk.Controller.DialogueListener.
Reimplemented in EasyTalk.Display.DialogueDisplay.
|
private |
Enables and disables Unity standard Text components and TextMeshPro components based on whether TextMeshPro is enabled/installed.
|
virtual |
Called whenever a dialogue variable value is updated.
| variableName | The name of the variable. |
| value | The new value of the variable. |
Reimplemented from EasyTalk.Controller.DialogueListener.
|
virtual |
Called just before an asynchronous node is executed to notify listeners that the dialogue is about to enter a waiting state.
| asyncNode | The asynchronous node to be executed. |
Reimplemented from EasyTalk.Controller.DialogueListener.
| void EasyTalk.Display.AbstractDialogueDisplay.RemoveDialogueListener | ( | DialogueListener | dialogueListener | ) |
Removes the specified Dialogue Listener from the list of listeners.
| dialogueListener | The Dialogue Listener to remove. |
| void EasyTalk.Display.AbstractDialogueDisplay.RemoveDialogueListeners | ( | ) |
Removes all Dialogue Listeners of the display.
|
abstract |
Selects the next option in the option display (only applicable when options are being presented).
|
abstract |
Selects the option which most closely corresponds to the specified direction.
| direction | The direction to select an option in. |
|
abstract |
Selects the previous option in the option display (only applicable when options are being presented).
| void EasyTalk.Display.AbstractDialogueDisplay.SetActiveDialogueController | ( | DialogueController | dialogueController | ) |
Set the active dialogue controller for the dialogue display to communicate with.
| dialogueController | The dialogue controller to use. |
|
abstract |
Sets the continue display used by this dialogue display.
| continueDisplaY | The continue display to use. |
|
abstract |
Sets the conversation display used by the dialogue display.
| convoDisplay | The conversation display to use. |
| void EasyTalk.Display.AbstractDialogueDisplay.SetLanguage | ( | string | languageCode | ) |
Sets the language used by the dialogue display.
| languageCode | The ISO-639 language code to use. |
|
abstract |
Sets the option display being used by this dialogue display.
| optionDisplay | The option display to use. |
|
abstract |
Sets the TextInputDisplay used to retrieve text input from the player.
| textInputDisplay | The TextInputDisplay to use. |
|
protected |
Translates the text set on the conversation display and option display based on the currently set language of EasyTalkGameState.Instance.
|
protected |
Updates all of the fonts on child text components based on the language currently being used.
| component | The component to update. |
|
virtual |
Called whenever the dialogue encounters a wait node.
| timeInSeconds | The amount of time which the dialogue will wait before proceeding (in seconds). |
Reimplemented from EasyTalk.Controller.DialogueListener.
|
private |
When set to true, the dialogue display allows an immediate exit from the currently running dialogue.
|
protected |
When true, the dialogue display will be destroyed when a new scene is loaded.
|
protected |
The currently active dialogue controller.
|
protected |
A collection of Dialogue Listeners to call as dialogue playback occurs.
|
protected |
The EasyTalk dialogue settings to use.
|
staticprotected |
An instance of a Dialogue Display.
|
private |
A flag indicating whether continuation is currently permitted in the conversation.
|
private |
A flag indicating whether option selection is currently permitted.
| UnityEvent EasyTalk.Display.AbstractDialogueDisplay.onContinueDisabled |
A Unity Event which is triggered whenever continuation of the current dialogue is disabled.
| UnityEvent EasyTalk.Display.AbstractDialogueDisplay.onContinueEnabled |
A Unity Event which is triggered whenever continuation of the current dialogue is allowed.
| UnityEvent EasyTalk.Display.AbstractDialogueDisplay.onOptionSelectionDisabled |
A Unity Event which is triggered whenever option selection is disabled (after an option is chosen).
| UnityEvent EasyTalk.Display.AbstractDialogueDisplay.onOptionSelectionEnabled |
A Unity Event which is triggered whenever option selection is enabled (after options are presented).
|
get |
Returns the current DialogueController being used by this dialogue display, if there is one.
|
getset |
Gets or sets the EasyTalk Dialogue Settings used by the display.
|
staticget |
Gets the dialogue display instance.
|
getset |
Gets or sets whether continuation is allowed by the player by pressing a button.
|
getprotected set |
A flag indicating whether the dialogue is currently displaying a conversation (rather than options).
|
getset |
Gets or sets whether the dialogue is currently allowing options to be selected by the player.
|
getprivate set |
A flag indicating whether the display is currently playing a dialogue.
|
getset |
Gets or sets whether the player is allowed to immediately exit the dialogue by pressing a button.