2.2 (Current)
API Documentation
C#
Yarn.Unity Namespace
DialogueRunner
DialogueRunner
Class in Yarn.Unity​
Inherits from MonoBehaviour

Summary

The DialogueRunner component acts as the interface between your game and Yarn Spinner.
public class DialogueRunner : MonoBehaviour

Classes

Name
Description
​StringUnityEvent​
A type of UnityEvent that takes a single string parameter.

Fields

Name
Description
​dialogueViews​
The View classes that will present the dialogue to the user.
​lineProvider​
​
​onCommand​
A StringUnityEvent that is called when a Command is received.
​onDialogueComplete​
A Unity event that is called once the dialogue has completed.
​onNodeComplete​
A Unity event that is called when a node is complete.
​onNodeStart​
A Unity event that is called when a node starts running.
If true, when an option is selected, it's as though it were a line.
​startAutomatically​
Whether the DialogueRunner should automatically start running dialogue after the scene loads.
​startNode​
The name of the node to start from.
​verboseLogging​
If true, will print Debug.Log messages every time it enters a node, and other frequent events.
​yarnProject​
The YarnProject asset that should be loaded on scene start.

Methods

Name
Description
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Adds a command handler. Dialogue will pause execution after the command is called.
Add a new function that returns a value, so that it can be called from Yarn scripts.
​Clear()​
Unloads all nodes from the Dialogue .
Returns the collection of tags that the node associated with the node named nodeName.
Loads all variables from the PlayerPrefs object into the Dialogue Runner's variable storage.
​NodeExists(string)​
Returns true when a node named nodeName has been loaded.
Called by a DialogueViewBase derived class from dialogueViews to inform the DialogueRunner that the user intents to proceed to the next line.
Removes a command handler.
Remove a registered function.
Starts running the dialogue again.
Saves all variables in the Dialogue Runner's variable storage into the PlayerPrefs object.
Sets the dialogue views and makes sure the callback DialogueViewBase.MarkLineComplete will respond correctly.
Loads any initial variables declared in the program and loads that variable with its default declaration value into the variable storage. Any variable that is already in the storage will be skipped, the assumption is that this means the value has been overridden at some point and shouldn't be otherwise touched. Can force an override of the existing values with the default if that is desired.
Replaces this DialogueRunner's yarn project with the provided project.
Splits input into a number of non-empty sub-strings, separated by whitespace, and grouping double-quoted strings into a single sub-string.
Start the dialogue from a specific node.
​Stop()​
Stops the Dialogue .

Properties

Name
Description
​CurrentNodeName​
Gets the name of the current node that is being run.
​Dialogue​
Gets the underlying Dialogue object that runs the Yarn code.
​IsDialogueRunning​
Gets a value that indicates if the dialogue is actively running.
​VariableStorage​
The variable storage object.
Last modified 5mo ago
Export as PDF
Copy link
Edit on GitHub
On this page
Summary
Classes
Fields
Methods
Properties