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).

VoiceOverPresenter

A subclass of DialoguePresenterBase that plays voice-over AudioClips for lines of dialogue.
public sealed class VoiceOverPresenter : DialoguePresenterBase

Inherits from Yarn.Unity.DialoguePresenterBase

#Fields

#audioSource

The AudioSource that this voice over view will play its audio from.
public AudioSource audioSource;

Type AudioSource

If this is null, a new AudioSource will be added at runtime.

#endLineWhenVoiceoverComplete

If true, the voice over view will request that the dialogue runner proceed to the next line when audio for the line has finished playing.
public bool endLineWhenVoiceoverComplete = true;

Type Boolean

#fadeOutTimeOnLineFinish

The fade out time when the line is interrupted during playback.
public float fadeOutTimeOnLineFinish = 0.05f;

Type Single

#waitTimeAfterLineComplete

The amount of time after playback has completed before this view reports that it's finished delivering the line.
public float waitTimeAfterLineComplete = 0f;

Type Single

#waitTimeBeforeLineStart

The amount of time to wait before starting playback of the line.
public float waitTimeBeforeLineStart = 0f;

Type Single

#Methods

#OnDialogueCompleteAsync(CancellationToken)

Called by the DialogueRunner to signal that the dialogue has ended, and no more content will be delivered.
public override YarnTask OnDialogueCompleteAsync(CancellationToken token)

Parameters

  • tokenCancellationToken
    The cancellation token for this task, if cancelled this method should finish as soon as possible.

Returns YarnTask: A task that represents any work done by this dialogue presenter in order to clean up after running dialogue.

This method is called after the last piece of content (that is, lines, options or commands) finished running.

This method is a good place to perform tasks like dismissing on-screen dialogue UI (for example, turning off a letterboxing effect, or hiding dialogue UI elements.)

The default implementation of this method does nothing.

#OnDialogueStartedAsync(CancellationToken)

Called by the DialogueRunner to signal that dialogue has started.
public override YarnTask OnDialogueStartedAsync(CancellationToken token)

Parameters

  • tokenCancellationToken
    The cancellation token for this task, if cancelled this method should finish as soon as possible.

Returns YarnTask: A task that represents any work done by this dialogue presenter in order to get ready for dialogue to run.

This method is called before any content (that is, lines, options or commands) are delivered.

This method is a good place to perform tasks like preparing on-screen dialogue UI (for example, turning on a letterboxing effect, or making dialogue UI elements visible.)

The default implementation of this method does nothing.

#RunLineAsync(LocalizedLine, LineCancellationToken)

Begins playing the associated audio for the specified line.
public override async YarnTask RunLineAsync(LocalizedLine dialogueLine, LineCancellationToken lineCancellationToken)

Parameters

Returns YarnTask

This method is not intended to be called from your code. Instead, the DialogueRunner class will call it at the appropriate time.

See also

Generated from Yarn Spinner for Unity 3.3.