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...
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...
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...
Class in Yarn.Unity
Inherits from System.Object
Assembly.GetTypes() can throw in some cases. This extension will catch that exception and return only the types which were successfully loaded from the assembly.
Method in AssemblyExtensions
Assembly.GetTypes() can throw in some cases. This extension will catch that exception and return only the types which were successfully loaded from the assembly.
Assembly
@this
Field in Culture
The unique language ID used to identify a language as RFC 4646. Will be "de-CH" for "German (Switzerland)". Use this for storing settings or identifying a language.
Field in Culture
The languages name as called in the language itself. Will be "Deutsch (Schweiz) for "de-CH". Use this to present the language in-game so people can find their native language.
Field in DialogueCharacterNameView
Invoked when a line is received that contains a character name. The name is given as the parameter.
DialogueCharacterNameView.onNameNotPresent: Invoked when a line is received that doesn't contain a character name.
Method in Cultures
Returns a boolean value indicating whether name
is a valid identifier for retrieving a Culture from GetCulture(string) .
string
name
true
if name is a valid Culture name; false
otherwise.
Field in Culture
The display name of a language. Will be "German (Switzerland)" for "de-CH". Use this value to present the language in an English UI.
Field in DialogueCharacterNameView
Invoked when a line is received that doesn't contain a character name.
Games can use this event to hide the name UI.
DialogueCharacterNameView.onNameUpdate: Invoked when a line is received that contains a character name. The name is given as the parameter.
Field in DialogueRunner
A StringUnityEvent that is called when a Command
is received.
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 MonoBehaviour
in the scene with the attribute YarnCommandAttribute.
When a command is delivered in this way, the DialogueRunner will not pause execution. If you want a command to make the DialogueRunner pause execution, see AddCommandHandler(string, CommandHandler)
.
This method receives the full text of the command, as it appears between the <<
and >>
markers.
AddCommandHandler(string, CommandHandler)
AddCommandHandler(string, CommandHandler)
YarnCommandAttribute: An attribute that marks a method on an object as a command.
Field in DialogueRunner
Whether the DialogueRunner should automatically proceed to the next line once a line has been finished.
Field in DialogueRunner
A Unity event that is called once the dialogue has completed.
Dialogue.DialogueCompleteHandler
Field in DialogueRunner
Whether the DialogueRunner should automatically start running dialogue after the scene loads.
The node specified by startNode will be used.
Field in DialogueRunner
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.
Dialogue.NodeCompleteHandler
Field in DialogueRunner
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.
Dialogue.NodeStartHandler
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Func<Coroutine>
handler
The CommandHandler
that will be invoked when the command is called.
Field in DialogueRunner
The name of the node to start from.
This value is used to select a node to start from when startAutomatically is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Action<T1>
handler
The CommandHandler
that will be invoked when the command is called.
Field in DialogueRunner
If true, will print Debug.Log messages every time it enters a node, and other frequent events.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Func<T1, Coroutine>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Action
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Func<T1, T2, Coroutine>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Action<T1, T2, T3>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Func<T1, T2, T3, Coroutine>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Action<T1, T2, T3, T4>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Func<T1, T2, T3, T4, T5, Coroutine>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Func<T1, T2, T3, T4, Coroutine>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Action<T1, T2, T3, T4, T5>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Action<T1, T2, T3, T4, T5, T6>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Func<T1, T2, T3, T4, T5, T6, Coroutine>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
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 Coroutine
, when the command is run, the DialogueRunner will wait for the returned coroutine to stop before delivering any more content.
string
commandName
The name of the command.
System.Action<T1, T2>
handler
The CommandHandler
that will be invoked when the command is called.
Method in DialogueRunner
string
name
System.Func<TResult, T1, T2, T3, T4, T5, T6>
implementation
T6
The type of the sixth parameter to the function.
Method in DialogueRunner
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:
System.Func<TResult>
implementation
The Delegate
that should be invoked when this function is called.
string
name
TResult
The type of the value that the function should return.
Library
Method in DialogueRunner
string
name
System.Func<TResult, T1, T2, T3>
implementation
T3
The type of the third parameter to the function.
Method in DialogueRunner
string
name
System.Func<TResult, T1, T2>
implementation
T2
The type of the second parameter to the function.
Method in DialogueRunner
string
name
System.Func<TResult, T1>
implementation
T1
The type of the first parameter to the function.
Contains classes for working with Yarn Spinner in the Unity game engine.
The DialogueRunner component acts as the interface between your game and Yarn Spinner.
Provides methods for finding voice over AudioClip
s in the project matching a Yarn linetag/string ID and a language ID.
A simple implementation of VariableStorageBehaviour.
Represents a line, ready to be presented to the user in the localisation they have specified.
Detects if the render pipeline is different from the one the samples were created with, and warn you that things might look odd.
An IDictionary<TKey,TValue>
that can be serialized as part of a Unity object.
Handles playback of voice over AudioClip
s referenced on YarnScript
s.
An attribute that marks a method on an object as a command.
Marks the method as a function to be registered with the running instance's library.
Shows Yarn lines on Canvas Text components.
Yarn parameter.
Inject state for any commands in this class using this static method.
Holds information about a language.
Class in Yarn.Unity
Inherits from DialogueViewBase
A subclass of DialogueViewBase that displays character names.
This class uses the character
attribute on lines that it receives to determine its content. When the view's RunLine(LocalizedLine,Action) method is called with a line whose Text contains a character
attribute, the onNameUpdate event is fired. If the line does not contain such an attribute, the onNameNotPresent event is fired instead.
This view does not present any options or handle commands. It's intended to be used alongside other subclasses of DialogueViewBase.
Invoked when the dialogue is started.
Invoked when a line is received that doesn't contain a character name.
Invoked when a line is received that contains a character name. The name is given as the parameter.
DialogueUI
Class in Yarn.Unity
Inherits from MonoBehaviour
The DialogueRunner component acts as the interface between your game and Yarn Spinner.
A type of UnityEvent
that takes a single string parameter.
Whether the DialogueRunner should automatically proceed to the next line once a line has been finished.
The View classes that will present the dialogue to the user.
A Unity event that is called once the dialogue has completed.
A Unity event that is called when a node is complete.
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.
Whether the DialogueRunner should automatically start running dialogue after the scene loads.
The name of the node to start from.
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.
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.
Returns the collection of tags that the node associated with the node named nodeName
.
Returns true
when a node named nodeName
has been loaded.
Removes a command handler.
Remove a registered function.
Starts running the dialogue again.
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.
Gets the name of the current node that is being run.
Gets a value that indicates if the dialogue is actively running.
The variable storage object.
Class in Yarn.Unity
Inherits from LineProviderBehaviour
Class in Yarn.Unity
Inherits from LocalizedLine
DialogueLine's voice over clip
Class in Yarn.Unity
Inherits from DialogueViewBase
Method in CharacterColorView
dialogueLine
Action
onDialogueLineFinished
Struct in Yarn.Unity
Inherits from System.ValueType
Holds information about a language.
The display name of a language. Will be "German (Switzerland)" for "de-CH". Use this value to present the language in an English UI.
The unique language ID used to identify a language as RFC 4646. Will be "de-CH" for "German (Switzerland)". Use this for storing settings or identifying a language.
The languages name as called in the language itself. Will be "Deutsch (Schweiz) for "de-CH". Use this to present the language in-game so people can find their native language.
Class in Yarn.Unity
Inherits from System.Object
Provides access to all Culture s supported by Yarn Spinner.
Returns the represented by the language code in name
.
Returns a boolean value indicating whether name
is a valid identifier for retrieving a from .
Method in DialogueCharacterNameView
dialogueLine
Action
onDialogueLineFinished
Class in Yarn.Unity
Inherits from System.Object
The ID of this dialogue option
Indicates whether this value should be presented as available or not.
The line for this dialogue option
The ID of the dialogue option's text
Provides access to all s supported by Yarn Spinner.
A subclass of that displays character names.
A MonoBehaviour
that can present the data of a dialogue executed by a to the user. The uses subclasses of this type to relay information to and from the user, and to pause and resume the execution of the YarnScript
.
A MonoBehaviour
that produces s.
A MonoBehaviour
that a uses to store and retrieve variables.
The presentation status of a .
A that is called when a Command
is received.
The asset that should be loaded on scene start.
Unloads all nodes from the .
Called by a derived class from to inform the that the user intents to proceed to the next line.
Stops the .
Gets the underlying object that runs the Yarn code.
string
name
System.Func<TResult, T1, T2, T3, T4>
implementation
T4
The type of the fourth parameter to the function.
Method in DialogueRunner
Removes a command handler.
string
commandName
The name of the command to remove.
Method in DialogueRunner
Returns the collection of tags that the node associated with the node named nodeName
.
String
nodeName
The name of the node.
The collection of tags associated with the node, or null
if no node with that name exists.
Method in DialogueRunner
string
name
System.Func<TResult, T1, T2, T3, T4, T5>
implementation
T5
The type of the fifth parameter to the function.
Method in DialogueRunner
Called by a DialogueViewBase derived class from dialogueViews to inform the DialogueRunner that the user intents to proceed to the next line.
Method in DialogueRunner
Returns true
when a node named nodeName
has been loaded.
string
nodeName
The name of the node.
true
if the node is loaded, false
otherwise/
Method in DialogueRunner
Starts running the dialogue again.
If nodeName
is null, the node specified by startNode is attempted, followed the currently running node. If none of these options are available, an ArgumentNullException
is thrown.
string
nodeName
Method in DialogueRunner
Remove a registered function.
After a function has been removed, it cannot be called from Yarn scripts.
string
name
The name of the function to remove.
AddFunction<TResult>(string, Func<TResult>)
Property in DialogueRunner
Gets the name of the current node that is being run.
Dialogue.currentNode
Method in DialogueRunner
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.
bool
overrideExistingValues
Method in DialogueRunner
Sets the dialogue views and makes sure the callback DialogueViewBase.MarkLineComplete
will respond correctly.
views
The array of views to be assigned.
Method in DialogueRunner
Replaces this DialogueRunner's yarn project with the provided project.
newProject
Method in
Splits input into a number of non-empty sub-strings, separated by whitespace, and grouping double-quoted strings into a single sub-string.
This method behaves similarly to the string.Split(char[], StringSplitOptions)
method with the StringSplitOptions
parameter set to 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.
string
input
The string to split.
Class in DialogueRunner
Inherits from UnityEvent
1`
A type of UnityEvent
that takes a single string parameter.
A concrete subclass of UnityEvent
is needed in order for Unity to serialise the type correctly.
Method in DialogueRunner
Start the dialogue from a specific node.
string
startNode
The name of the node to start running from.
Method in DialogueViewBase
Called by the DialogueRunner to signal that the dialogue has ended, and no more lines will be delivered.
The default implementation does nothing.
Class in Yarn.Unity
Inherits from MonoBehaviour
A MonoBehaviour
that can present the data of a dialogue executed by a DialogueRunner to the user. The DialogueRunner uses subclasses of this type to relay information to and from the user, and to pause and resume the execution of the YarnScript
.
The term "view" is meant in the broadest sense, e.g. a view on the dialogue (MVVM pattern). Therefore, this abstract class only defines how a specific view on the dialogue should communicate with the DialogueRunner (e.g. display text or trigger a voice over clip). How to present the content to the user will be the responsibility of all classes inheriting from this class.
The inheriting classes will receive a LocalizedLine and can be in one of the stages defined in DialogueLineStatus
while presenting it.
Signals that a conversation has started.
Called by the DialogueRunner to indicate that the line that this view is delivering has changed state.
Signals that the user wants to go to the next line.
DialogueRunner.dialogueViews: The View classes that will present the dialogue to the user.
DialogueUI
Called by the to signal that the dialogue has ended, and no more lines will be delivered.
Called by the to signal that the view should dismiss its current line from display, and clean up.
Called by the to signal that the end of a node has been reached.
Called by the to signal that a line should be displayed to the user.
Called by the to signal that a set of options should be displayed to the user.
Method in DialogueViewBase
Called by the DialogueRunner to signal that the view should dismiss its current line from display, and clean up.
Action
onDismissalComplete
The method that should be called when the view has finished dismissing the line.
Method in DialogueViewBase
Called by the DialogueRunner to signal that a set of options should be displayed to the user.
When this method is called, the DialogueRunner will pause execution until the `onOptionSelected` method is called.
If your scene includes multiple dialogue views that override this method, they will all receive a call each time the dialogue system presents options to the player. You must ensure that only one of them calls the onOptionSelected
method.
dialogueOptions
The set of options that should be displayed to the user.
Action<int>
onOptionSelected
A method that should be called when the user has made a selection.
Method in DialogueViewBase
Signals that the user wants to go to the next line.
This method is generally called by a "continue" button, and causes the DialogueUI to signal the DialogueRunner to proceed to the next piece of content.
If this method is called before the line has finished appearing (that is, before the line's status changes to FinishedPresenting ), the line's status will change to Interrupted , and OnLineStatusChanged(LocalizedLine) will be called to notify the view.
Method in DialogueViewBase
Called by the DialogueRunner to signal that the end of a node has been reached.
This method may be called multiple times before DialogueComplete() is called. If this method returns Dialogue.HandlerExecutionType.ContinueExecution
, do not call the onComplete
method.
The default implementation does nothing.
string
nextNode
The name of the next node that is being entered.
Action
onComplete
A method that should be called to /// indicate that the DialogueRunner should continue executing.
Method in Effects
A coroutine that fades a CanvasGroup
object's opacity from from
to to
over the course of fadeTime
seconds, and then invokes onComplete
. An InterruptionFlag may be used to signal that the fade should be interrupted; if this happens, the opacity is set to to
.
float
from
The opacity value to start fading from, ranging from 0 to 1.
float
to
The opacity value to end fading at, ranging from 0 to 1.
Action
onComplete
A delegate to invoke after fading is complete.
CanvasGroup
canvasGroup
float
fadeTime
interruption
Class in Yarn.Unity
Inherits from System.Object
A coroutine that fades a CanvasGroup
object's opacity from from
to to
over the course of fadeTime
seconds, and then invokes onComplete
. An may be used to signal that the fade should be interrupted; if this happens, the opacity is set to to
.
Method in DialogueViewBase
Called by the DialogueRunner to indicate that the line that this view is delivering has changed state.
Subclasses of DialogueViewBase should override this method to be notified when a line has become interrupted, and when the line has finished being delivered by all views.
The default implementation does nothing.
dialogueLine
The that has changed state.
LineStatus: The presentation status of a LocalizedLine .
dialogueLine
The content of the line that should be presented to the user.
Action
onDialogueLineFinished
The method that should be called after the line has been finished.