DialogueRunner
Class in Yarn.Unity
Inherits from UnityEngine.MonoBehaviour
Summary
public class DialogueRunner : IActionRegistration
Fields
Name Description autoStart Whether the dialogue runner will immediately start running dialogue after loading. onDialogueComplete A Unity event that is called once the dialogue has completed. onDialogueStart A Unity event that is called when the dialogue starts running. onNodeComplete A Unity event that is called when a node is complete. onNodeStart A Unity event that is called when a node starts running. onUnhandledCommand A UnityEventString that is called when a Command is received and no command handler was able to handle it. runSelectedOptionAsLine If 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. startNode The name of the node that will start running immediately after loading. verboseLogging If true, will print Debug.Log messages every time it enters a node, and other frequent events.
Methods
Name Description 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