Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

OptionsPresenter

Receives options from a DialogueRunner, and displays and manages a collection of OptionItem views for the user to choose from.
public sealed class OptionsPresenter : DialoguePresenterBase

Inherits from Yarn.Unity.DialoguePresenterBase

#Fields

#fadeDownDuration

How long should the fade down last?
public float fadeDownDuration = 0.1f;

Type Single

#fadeUpDuration

How long should the fade up last?
public float fadeUpDuration = 0.25f;

Type Single

#showUnavailableOptions

Controls whether or not to display options whose IsAvailable value is false.
public bool showUnavailableOptions = false;

Type Boolean

#useFadeEffect

Should the UI fade to show and hide the options?
public bool useFadeEffect = true;

Type Boolean

#Methods

#OnDialogueCompleteAsync(CancellationToken)

Called by a DialogueRunner to dismiss the options view when dialogue is complete.
public override YarnTask OnDialogueCompleteAsync(CancellationToken token)

Parameters

  • tokenCancellationToken

Returns YarnTask: A completed task.

#OnDialogueStartedAsync(CancellationToken)

Called by a DialogueRunner to set up the options view when dialogue begins.
public override YarnTask OnDialogueStartedAsync(CancellationToken token)

Parameters

  • tokenCancellationToken

Returns YarnTask: A completed task.

#RunLineAsync(LocalizedLine, LineCancellationToken)

Called by a DialogueRunner when a line needs to be presented, and stores the line as the 'last seen line' so that it can be shown when options appear.
public override YarnTask RunLineAsync(LocalizedLine line, LineCancellationToken token)

Parameters

Returns YarnTask: A completed task.

This view does not display lines directly, but instead stores lines so that when options are run, the last line that ran before the options appeared can be shown.

#RunOptionsAsync(DialogueOption[], LineCancellationToken)

Called by a DialogueRunner to display a collection of options to the user.
public override async YarnTask<DialogueOption?> RunOptionsAsync(DialogueOption[] dialogueOptions, LineCancellationToken cancellationToken)

Parameters

Returns YarnTask: A task that indicates which option was selected, or that this dialogue presenter did not select an option.

Generated from Yarn Spinner for Unity 3.3.