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

ILineProvider

Contains methods for retrieving user-facing localized content, given non-localized line IDs.
public interface ILineProvider

#Properties

#LocaleCode

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

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 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 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 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, Yarn.Markup.IAttributeMarkerProcessor)

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

Parameters

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

Generated from Yarn Spinner for Unity 3.3.