Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Field in
Whether the dialogue runner will immediately start running dialogue after loading.
public bool autoStart = false;Class in Yarn.Unity
Inherits from UnityEngine.MonoBehaviour
public class DialogueRunner : IActionRegistrationWhether the dialogue runner will immediately start running dialogue after loading.
A Unity event that is called once the dialogue has completed.
A Unity event that is called when the dialogue starts running.
A Unity event that is called when a node is complete.
A Unity event that is called when a node starts running.
A that is called when a is received and no command handler was able to handle it.
If this value is set, when an option is selected, the line contained in it ( ) will be delivered to the dialogue runner's dialogue presenters as though it had been written as a separate line.
The name of the node that will start running immediately after loading.
If true, will print Debug.Log messages every time it enters a node, and other frequent events.
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.
Gets the internal object that reads and executes the Yarn script.
Gets or sets the collection of dialogue presenters attached to this dialogue runner.
Add a new function that returns a value, so that it can be called from Yarn scripts.
Loads all variables from the requested file in persistent storage into the Dialogue Runner's variable storage.
Removes a command handler.
Remove a registered function.
Requests that all dialogue presenters speed up their delivery of the current line.
Requests that all dialogue presenters stop showing the current line, and prepare to show the next piece of content.
Saves all variables from variable storage into the persistent storage.
Sets the dialogue runner's Yarn Project.
Splits input into a number of non-empty sub-strings, separated by whitespace, and grouping double-quoted strings into a single sub-string.
Starts running a node of dialogue.
Stops the dialogue immediately, and cancels any currently running dialogue presenters.
Gets a that completes when the dialogue runner finishes its dialogue.
Gets or sets the collection of dialogue presenters attached to this dialogue runner.
Gets a value that indicates if the dialogue is actively running.
Gets the that this dialogue runner uses to fetch localized line content.
Gets the VariableStorage that this dialogue runner uses to store and access Yarn variables.
Gets the asset that this dialogue runner uses.
Method in DialogueRunner
Stops the dialogue immediately, and cancels any currently running dialogue presenters.
public async YarnTask Stop()Method in DialogueRunner
Adds a command handler. Dialogue will pause execution after the command is called.
public void AddCommandHandler(string commandName, MethodInfo method);When this command handler has been added, it can be called from your Yarn scripts like so:
<<commandName param1 param2>>If handler is a method that returns a UnityEngine.Coroutine, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
If handler is a method that returns an System.Collections.IEnumerator, when the command is run, the DialogueRunner will start a coroutine using that method and wait for that coroutine to stop before delivering any more content.
Method in DialogueRunner
Saves all variables from variable storage into the persistent storage.
public bool SaveStateToPersistentStorage(string saveFileName)This method attempts to writes the contents of VariableStorage as a JSON file and saves it to the persistent data storage under the file name saveFileName. The saved information can be loaded via the LoadStateFromPersistentStorage(string) method.
If saveFileName already exists, it will be overwritten, not appended.
true if the variables were successfully written into the player preferences; false otherwise.
Method in DialogueRunner
public void RegisterFunctionDeclaration(string name, Type returnType, Type[] parameterTypes)string name
Type returnType
Method in
Adds a command handler. Dialogue will pause execution after the command is called.
When this command handler has been added, it can be called from your Yarn scripts like so:
If handler is a method that returns a UnityEngine.Coroutine, when the command is run, the will wait for the returned coroutine to stop before delivering any more content.
If handler is a method that returns an System.Collections.IEnumerator, when the command is run, the will start a coroutine using that method and wait for that coroutine to stop before delivering any more content.
Method in
Sets the dialogue runner's Yarn Project.
If the dialogue runner is currently running (that is, is true ), an System.InvalidOperationException is thrown.
Property in
Gets a value that indicates if the dialogue is actively running.
Property in
Gets the that this dialogue runner uses to fetch localized line content.
Type[] parameterTypes
string saveFileName
the name the save file should have on disc, including any file extension
public bool IsDialogueRunning { get }public ILineProvider LineProvider { get; }string commandName
The name of the command.
handler
The that will be invoked when the command is called.
commandName
The name of the command.
public void AddCommandHandler(string commandName, Delegate handler);<<commandName param1 param2>>public void SetProject(YarnProject project)Method in
Removes a command handler.
methodInfo
The method that will be invoked when the command is called.
MethodInfo method
public void RemoveCommandHandler(string commandName);string commandName
The name of the command to remove.
string commandName
The name of the command.
Delegate handler
The that will be invoked when the command is called.
project
The new to be used.
Property in
Gets or sets the collection of dialogue presenters attached to this dialogue runner.
This property is deprecated. Use instead.
public IEnumerable<DialoguePresenterBase?> DialogueViews { get; set; }This property is obsolete and may be removed from a future version of Yarn Spinner: Use DialoguePresenters.
Field in
If this value is set, when an option is selected, the line contained in it ( ) will be delivered to the dialogue runner's dialogue presenters as though it had been written as a separate line.
This allows a Yarn script to
public bool runSelectedOptionAsLine = false;Field in
A Unity event that is called once the dialogue has completed.
: Gets or sets the that is called when the dialogue reaches its end.
public UnityEvent? onDialogueComplete;Field in DialogueRunner
A UnityEventString that is called when a Command is received and no command handler was able to handle it.
public UnityEventString? onUnhandledCommand;Use this method to dispatch a command to other parts of your game. This method is only called if the Command has not been handled by a command handler that has been added to the DialogueRunner, or by a method on a UnityEngine.MonoBehaviour in the scene with the attribute YarnCommandAttribute.
This method receives the full text of the command, as it appears between the << and >> markers.
: Adds a command handler. Dialogue will pause execution after the command is called.
: An attribute that marks a method on an object as a command.
Field in
A Unity event that is called when the dialogue starts running.
public UnityEvent? onDialogueStart;Field in DialogueRunner
If true, will print Debug.Log messages every time it enters a node, and other frequent events.
public bool verboseLogging = false;Method in DialogueRunner
Requests that all dialogue presenters speed up their delivery of the current line.
public void RequestHurryUpLine()The specific behaviour of what happens when this method is called depends on the implementation of the Dialogue Runner's current dialogue presenters.
If the dialogue runner is not currently running a line (for example, if it is running options, or is not running dialogue at all), this method has no effect.
Method in DialogueRunner
Splits input into a number of non-empty sub-strings, separated by whitespace, and grouping double-quoted strings into a single sub-string.
public static IEnumerable<string> SplitCommandText(string input)This method behaves similarly to the System.String.Split(System.Char[],System.StringSplitOptions) method with the System.StringSplitOptions parameter set to System.StringSplitOptions.RemoveEmptyEntries , with the following differences:
Text that appears inside a pair of double-quote characters will not be split.
Text that appears after a double-quote character and before the end of the input will not be split (that is, an unterminated double-quoted string will be treated as though it had been terminated at the end of the input.)
When inside a pair of double-quote characters, the string \\ will be converted to \, and the string \" will be converted to ".
A collection of sub-strings.
Method in
Add a new function that returns a value, so that it can be called from Yarn scripts.
When this function has been registered, it can be called from your Yarn scripts like so:
The call command can also be used to invoke the function:
string input
The string to split.
: A collection of functions that can be called from Yarn programs.
public void AddFunction(string name, Delegate implementation);<<if myFunction(1, 2) == true>>
myFunction returned true!
<<endif>><<call myFunction(1, 2)>>string name
The name of the function to add.
Delegate implementation
The System.Delegate that should be invoked when this function is called.
Field in
The name of the node that will start running immediately after loading.
This value must be the name of a node present in .
: Gets the asset that this dialogue runner uses.
: Starts running a node of dialogue.
public string startNode = "Start";Field in
A Unity event that is called when a node is complete.
This event receives as a parameter the name of the node that just finished running.
: Gets or sets the that is called when a node is complete.
public UnityEventString? onNodeComplete;Method in DialogueRunner
Starts running a node of dialogue.
public async YarnTask StartDialogue(string nodeName)nodeName must be the name of a node in YarnProject .
string nodeName
The name of the node to run.
Field in
A Unity event that is called when a node starts running.
This event receives as a parameter the name of the node that is about to start running.
: Gets or sets the that is called when a node is started.
public UnityEventString? onNodeStart;Method in DialogueRunner
Remove a registered function.
public void RemoveFunction(string name);After a function has been removed, it cannot be called from Yarn scripts.
string name
The name of the function to remove.
: Add a new function that returns a value, so that it can be called from Yarn scripts.
Property in
Gets a that completes when the dialogue runner finishes its dialogue.
If the dialogue is not currently running when this property is accessed, the property returns a task that is already complete.
public YarnTask DialogueTask { get; }Property in
Gets or sets the collection of dialogue presenters attached to this dialogue runner.
public IEnumerable<DialoguePresenterBase?> DialoguePresenters { get; set; }Property in
Gets the asset that this dialogue runner uses.
: Sets the dialogue runner's Yarn Project.
public YarnProject? YarnProject { get }Method in DialogueRunner
Loads all variables from the requested file in persistent storage into the Dialogue Runner's variable storage.
public bool LoadStateFromPersistentStorage(string saveFileName)This method loads the file saveFileName from the persistent data storage and attempts to read it as JSON. This is then deserialised and loaded into the VariableStorage.
The loaded information can be stored via the SaveStateToPersistentStorage(string) method.
true if the variables were successfully loaded from the player preferences; false otherwise.
string saveFileName
the name the save file should have on disc, including any file extension
Method in
public static DialogueRunner? FindRunner(Component component)Component component
Property in
public static bool IsInPlaymode { get; }Method in
Requests that all dialogue presenters stop showing the current line, and prepare to show the next piece of content.
The specific behaviour of what happens when this method is called depends on the implementation of the Dialogue Runner's current dialogue presenters.
If the dialogue runner is not currently running a line (for example, if it is running options, or is not running dialogue at all), this method has no effect.
public void RequestNextLine()Property in
Gets the VariableStorage that this dialogue runner uses to store and access Yarn variables.
public VariableStorageBehaviour VariableStorage { get; set; }Property in
Gets the internal object that reads and executes the Yarn script.
public Dialogue Dialogue { get; }Property in
public static YarnTask<DialogueOption?> NoOptionSelected { get; }Method in
public void RequestHurryUpOption()