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

UnityLocalisedLineProvider

A line provider that uses the Unity Localization system to get localized content for Yarn lines.
public sealed class UnityLocalisedLineProvider : LineProviderBehaviour

Inherits from Yarn.Unity.LineProviderBehaviour

Implements Yarn.Unity.ILineProvider

#Properties

#LocaleCode

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

Type String

#Methods

#DeregisterMarkerProcessor(string)

Removes all marker processors that handle markers named attributeName.
public override 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 override async 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 override 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 override void RegisterMarkerProcessor(string attributeName, 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.