DialogueUI Class

Displays dialogue lines to the player, and sends user choices back to the dialogue system.

public class DialogueUI : DialogueUIBehaviour

Remarks

The DialogueUI component works closely with the DialogueRunner class. It receives Lines, OptionSets and Commands from the DialogueRunner, and conveys them to the rest of the game. It is also responsible for relaying input from the user to the DialogueRunner, such as option selection or the signal to proceed to the next line.

Methods

Name Description
DialogueComplete() Called by the DialogueRunner to signal that the dialogue has ended.
DialogueStarted() Signals that a conversation has started.
MarkLineComplete() Signals that the user has finished with a line, or wishes to skip to the end of the current line.
RunCommand(Command, Action) Called by the DialogueRunner to signal that a command should be executed.
RunLine(Line, ILineLocalisationProvider, Action) Called by the DialogueRunner to signal that a line should be displayed to the user.
RunOptions(OptionSet, ILineLocalisationProvider, Action) Called by the DialogueRunner to signal that a set of options should be displayed to the user.
SelectOption(Int32) Signals that the user has selected an option.

Fields

Name Description
dialogueContainer The object that contains the dialogue and the options.
onCommand A DialogueRunner.StringUnityEvent that is called when a Command is received.
onDialogueEnd A UnityEvent that is called when the dialogue ends.
onDialogueStart A UnityEvent that is called when the dialogue starts.
onLineEnd A UnityEvent that is called when a line has finished displaying, and should be removed from the screen.
onLineFinishDisplaying A UnityEvent that is called when a line has finished being delivered.
onLineStart A UnityEvent that is called when a Line has been delivered.
onLineUpdate A DialogueRunner.StringUnityEvent that is called when the visible part of the line’s localised text changes.
onOptionsEnd A UnityEvent that is called when an option has been selected, and the optionButtons should be hidden.
onOptionsStart A UnityEvent that is called when an OptionSet has been displayed to the user.
optionButtons The buttons that let the user choose an option.
textSpeed How quickly to show the text, in seconds per character

See Also

Source

Defined in Unity/Assets/YarnSpinner/Scripts/DialogueUI.cs, line 49.