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 : DialoguePresenterBaseInherits 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
- The line to present.
- A LineCancellationToken that represents whether the dialogue presenter should hurry it its presentation of the line, or stop showing the current line.
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
dialogueOptionsYarn.Unity.DialogueOption[]The set of options that should be displayed to the user.cancellationTokenYarn.Unity.LineCancellationTokenA LineCancellationToken that becomes cancelled when the dialogue runner no longer needs this dialogue presenter to return an option.
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.