This site is for Yarn Spinner v1, and won't be updated. Go to the current site.

DialogueRunner.AddCommandHandler Method

Adds a command handler. Dialogue will pause execution after the command is called.

public void AddCommandHandler(string commandName, DialogueRunner.BlockingCommandHandler handler)

Remarks

When this command handler has been added, it can be called from your Yarn scripts like so:

<<commandName param1 param2>>

When this command handler is called, the DialogueRunner will stop executing code. The DialogueRunner.BlockingCommandHandler will receive an Action to call when it is ready for the Dialogue Runner to resume executing code.

Parameters

Parameter Description
string commandName The name of the command.
DialogueRunner.BlockingCommandHandler handler The DialogueRunner.CommandHandler that will be invoked when the command is called.

Source

Defined in Unity/Assets/YarnSpinner/Scripts/DialogueRunner.cs, line 336.