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 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: Gets or sets the NodeStartHandler that is called when a node is started.
Field in DialogueRunner
A UnityEventString that is called when a Command is received and no command handler was able to handle it.
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.
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,Delegate).
This method receives the full text of the command, as it appears between the <<
and >>
markers.
DialogueRunner.AddCommandHandler(string,Delegate): Adds a command handler. Dialogue will pause execution after the command is called.
YarnCommandAttribute: An attribute that marks a method on an object as a command.
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 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.
string
commandName
The name of the command.
handler
commandName
The name of the command.
methodInfo
The method that will be invoked when the command is called.
System.Reflection.MethodInfo
method
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.
The that will be invoked when the command is called.
string
commandName
The name of the command.
System.Delegate
handler
The CommandHandler that will be invoked when the command is called.
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:
string
name
The name of the function to add.
System.Delegate
implementation
The System.Delegate
that should be invoked when this function is called.
Library: A collection of functions that can be called from Yarn programs.
Method in DialogueRunner
Loads all variables from the requested file in persistent storage into the Dialogue Runner's variable storage.
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.
string
saveFileName
the name the save file should have on disc, including any file extension
true
if the variables were successfully loaded from the player preferences; false
otherwise.
Method in DialogueRunner
This method is obsolete and may be removed from a future version of Yarn Spinner: LoadStateFromPlayerPrefs is deprecated, please use LoadStateFromPersistentStorage instead.
Loads all variables from the UnityEngine.PlayerPrefs
object into the Dialogue Runner's variable storage.
This method loads a string containing JSON from the UnityEngine.PlayerPrefs
object under the key SaveKey
, deserializes that JSON, and then uses the resulting object to set all variables in VariableStorage.
The loaded information can be stored via the SaveStateToPlayerPrefs(string) method.
string
SaveKey
The key to use when storing the variables.
true
if the variables were successfully loaded from the player preferences; false
otherwise.
VariableStorageBehaviour.SetAllVariables(FloatDictionary,StringDictionary,BoolDictionary,bool): Provides a unified interface for loading many variables all at once. Will override anything already in the variable storage.
Method in DialogueRunner
Removes a command handler.
string
commandName
The name of the command to remove.
Method in DialogueRunner
Requests that all dialogue views speed up their delivery of the current line.
The specific behaviour of what happens when this method is called depends on the implementation of the Dialogue Runner's current dialogue views.
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
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.
IActionRegistration.AddFunction(string,Delegate): Add a new function that returns a value, so that it can be called from Yarn scripts.
Method in DialogueRunner
Requests that all dialogue views 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 views.
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
This method is obsolete and may be removed from a future version of Yarn Spinner: SaveStateToPlayerPrefs is deprecated, please use SaveStateToPersistentStorage instead.
Saves all variables in the Dialogue Runner's variable storage into the UnityEngine.PlayerPrefs
object.
This method serializes all variables in VariableStorage into a string containing JSON, and then stores that string in the UnityEngine.PlayerPrefs
object under the key SaveKey
.
The stored information can be restored via the LoadStateFromPlayerPrefs(string) method.
string
SaveKey
The key to use when storing the variables.
VariableStorageBehaviour.GetAllVariables(): Provides a unified interface for exporting all variables. Intended to be a point for custom saving, editors, etc.
Method in DialogueRunner
Saves all variables from variable storage into the persistent storage.
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.
string
saveFileName
the name the save file should have on disc, including any file extension
true
if the variables were successfully written into the player preferences; false
otherwise.
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.
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 "
.
string
input
The string to split.
A collection of sub-strings.
Method in DialogueRunner
Starts running a node of dialogue.
nodeName
must be the name of a node in YarnProject .
string
nodeName
The name of the node to run.
Property in DialogueRunner
Gets a YarnTask 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.
Property in DialogueRunner
Gets or sets the collection of dialogue views attached to this dialogue runner.
Property in DialogueRunner
Gets the internal Dialogue object that reads and executes the Yarn script.
Property in DialogueRunner
Gets the ILineProvider that this dialogue runner uses to fetch localized line content.
Property in DialogueRunner
Gets the VariableStorage that this dialogue runner uses to store and access Yarn variables.
Class in Yarn.Unity
Inherits from UnityEngine.MonoBehaviour
Whether 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.
The name of the node that will start running immediately after loading.
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.
Creates a stack of typewriter pauses to use to temporarily halt the typewriter effect.
Loads all variables from the requested file in persistent storage into the Dialogue Runner's variable storage.
Loads all variables from the UnityEngine.PlayerPrefs
object into the Dialogue Runner's variable storage.
Removes a command handler.
Remove a registered function.
Requests that all dialogue views speed up their delivery of the current line.
Requests that all dialogue views stop showing the current line, and prepare to show the next piece of content.
Saves all variables from variable storage into the persistent storage.
Saves all variables in the Dialogue Runner's variable storage into the UnityEngine.PlayerPrefs
object.
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 views.
Gets or sets the collection of dialogue views attached to this dialogue runner.
Gets a value that indicates if the dialogue is actively running.
Gets the VariableStorage that this dialogue runner uses to store and access Yarn variables.
Method in DialogueRunner
Creates a stack of typewriter pauses to use to temporarily halt the typewriter effect.
This is intended to be used in conjunction with the PausableTypewriter(TextMeshProUGUI,float,Action,Action,Action,Stack<(int position, float duration)>,CoroutineInterruptToken) effect. The stack of tuples created are how the typewriter effect knows when, and for how long, to halt the effect.
The pause duration property is in milliseconds but all the effects code assumes seconds So here we will be dividing it by 1000 to make sure they interconnect correctly.
line
The line from which we covet the pauses
A stack of positions and duration pause tuples from within the line
Method in DialogueRunner
Sets the dialogue runner's Yarn Project.
If the dialogue runner is currently running (that is, IsDialogueRunning is true
), an System.InvalidOperationException
is thrown.
project
The new to be used.
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 views as though it had been written as a separate line.
Gets the internal object that reads and executes the Yarn script.
Gets a that completes when the dialogue runner finishes its dialogue.
Gets the that this dialogue runner uses to fetch localized line content.
Gets the asset that this dialogue runner uses.