DialogueRunner

Class in Yarn.Unity

Inherits from UnityEngine.MonoBehaviour

Summary

public class DialogueRunner : IActionRegistration

Fields

NameDescription
autoStartWhether the dialogue runner will immediately start running dialogue after loading.
onDialogueCompleteA Unity event that is called once the dialogue has completed.
onDialogueStartA Unity event that is called when the dialogue starts running.
onNodeCompleteA Unity event that is called when a node is complete.
onNodeStartA Unity event that is called when a node starts running.
onUnhandledCommandA UnityEventString that is called when a Command is received and no command handler was able to handle it.
runSelectedOptionAsLineIf this value is set, when an option is selected, the line contained in it ( Line ) will be delivered to the dialogue runner’s dialogue presenters as though it had been written as a separate line.
startNodeThe name of the node that will start running immediately after loading.
verboseLoggingIf true, will print Debug.Log messages every time it enters a node, and other frequent events.

Methods

NameDescription
AddCommandHandler(string,Delegate)Adds a command handler. Dialogue will pause execution after the command is called.
AddCommandHandler(string,MethodInfo)Adds a command handler. Dialogue will pause execution after the command is called.
AddFunction(string,Delegate)Add a new function that returns a value, so that it can be called from Yarn scripts.
FindRunner(Component)
LoadStateFromPersistentStorage(string)Loads all variables from the requested file in persistent storage into the Dialogue Runner’s variable storage.
RegisterFunctionDeclaration(string,Type,Type[])
RemoveCommandHandler(string)Removes a command handler.
RemoveFunction(string)Remove a registered function.
RequestHurryUpLine()Requests that all dialogue presenters speed up their delivery of the current line.
RequestHurryUpOption()
RequestNextLine()Requests that all dialogue presenters stop showing the current line, and prepare to show the next piece of content.
SaveStateToPersistentStorage(string)Saves all variables from variable storage into the persistent storage.
SetProject(YarnProject)Sets the dialogue runner’s Yarn Project.
SplitCommandText(string)Splits input into a number of non-empty sub-strings, separated by whitespace, and grouping double-quoted strings into a single sub-string.
StartDialogue(string)Starts running a node of dialogue.
Stop()Stops the dialogue immediately, and cancels any currently running dialogue presenters.

Properties

NameDescription
DialogueGets the internal Dialogue object that reads and executes the Yarn script.
DialoguePresentersGets or sets the collection of dialogue presenters attached to this dialogue runner.
DialogueTaskGets a YarnTask that completes when the dialogue runner finishes its dialogue.
DialogueViewsGets or sets the collection of dialogue presenters attached to this dialogue runner.
IsDialogueRunningGets a value that indicates if the dialogue is actively running.
IsInPlaymode
LineProviderGets the ILineProvider that this dialogue runner uses to fetch localized line content.
NoOptionSelected
VariableStorageGets the VariableStorage that this dialogue runner uses to store and access Yarn variables.
YarnProjectGets the YarnProject asset that this dialogue runner uses.