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

LineProviderBehaviour

A MonoBehaviour that produces LocalizedLines, for use in Dialogue Presenters.
public abstract class LineProviderBehaviour : MonoBehaviour, ILineProvider

Inherits from MonoBehaviour

Implements Yarn.Unity.ILineProvider

DialogueRunners use a LineProviderBehaviour to get LocalizedLines, which contain the localized information that is presented to the player through dialogue presenters.

#Properties

#LocaleCode

Gets the line provider's current locale identifier, as a BCP-47 code.
public abstract string LocaleCode { get; set; }

Type String

#YarnProject

The YarnProject that contains the localized data for lines.
public YarnProject? YarnProject { get; set; }

Type YarnProject

This property is set at run-time by the object that will be requesting content (typically a DialogueRunner).

#Methods

#DeregisterMarkerProcessor(string)

Removes all marker processors that handle markers named attributeName.
public abstract void DeregisterMarkerProcessor(string attributeName);

Parameters

  • attributeNamestring
    The name of the marker to remove processors for.

#GetLocalizedLineAsync(Line, CancellationToken)

Prepares and returns a LocalizedLine from the specified Line.
public abstract YarnTask<LocalizedLine> GetLocalizedLineAsync(Line line, CancellationToken cancellationToken);

Parameters

  • The Line to produce the LocalizedLine from.
  • cancellationTokenCancellationToken
    A cancellation token that indicates whether the process of fetching the localised version of line should be cancelled.

Returns YarnTask: A localized line, ready to be presented to the player.

#PrepareForLinesAsync(IEnumerable<string>, CancellationToken)

Signals to the line provider that lines with the provided line IDs may be presented shortly.
public virtual YarnTask PrepareForLinesAsync(IEnumerable<string> lineIDs, CancellationToken cancellationToken)

Parameters

  • lineIDsIEnumerable<string>
    A collection of line IDs that the line provider should prepare for.
  • cancellationTokenCancellationToken
    A cancellation token that indicates whether the operation should be cancelled.

Returns YarnTask

This method allows implementing classes a chance to prepare any neccessary resources needed to present these lines, like pre-loading voice-over audio. The default implementation does nothing.

Not every line may run; this method serves as a way to give the line provider advance notice that a line may run, not will run.

#RegisterMarkerProcessor(string, IAttributeMarkerProcessor)

Adds a new marker processor to the line provider.
public abstract void RegisterMarkerProcessor(string attributeName, IAttributeMarkerProcessor markerProcessor);

Parameters

  • attributeNamestring
    The name of the markers to use markerProcessor for.
  • The marker processor to add.

#Start()

Called by Unity when the LineProviderBehaviour has first appeared in the scene.
public virtual void Start()
This method is publicvirtual to allow subclasses to override it.

Generated from Yarn Spinner for Unity 3.3.