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

LineMetadata

Represents the bundles of metadata across all lines and a mechanism to retrieve a specific metadata bundle for a line.
public class LineMetadata

Inherits from System.Object

Line metadata is the contents of hashtags at the end of a line and any synthesised metadata added by the compiler or dialogue runner.

    Character: Why hello there #happy
    
This shows off a a line with one entry in the metadata happy.

Yarn Spinner may also synthesis metadata and add it to this entry as if you had manually done so. This is done for a variety of reasons and any metadata you do not care about can safely be ignored if you don't need that metadata. The most common synthesised metadata added to line is the lastline metadata. For more details on adding metadata see https://docs.yarnspinner.dev/write-yarn-scripts/advanced-scripting/tags-metadata.

#Constructors

#LineMetadata()

public LineMetadata()

#Methods

#AddMetadata(string, IEnumerable<string>)

adds a new metadata entry to the requested line. This will override any metadata already on the line.
public void AddMetadata(string lineID, IEnumerable<string> metadata)

Parameters

  • lineIDstring
    the id of the line, if the line has implicit tags this value may change between runs
  • metadataIEnumerable<string>
    the metadata to add onto this line

#GetLineIDs()

Gets the line IDs that contain metadata.
public IEnumerable<string> GetLineIDs()

Returns IEnumerable: The line IDs.

#GetMetadata(string)

Returns metadata for a given line ID, if any is defined.
public string[]? GetMetadata(string lineID)

Parameters

  • lineIDstring
    The line ID.

#GetShadowLineSource(string)

Shadow lines are specialcased because while their contents is the same as another line they may have significantly different metadata.
public string? GetShadowLineSource(string lineID)

Parameters

  • lineIDstring
    the id of the shadow line

Returns String: the metadata for the shadow line

The most common situation where a shadow line has different metadata than it's origin line is when it is the last line before options. In this case you will still want to know that this line is going to be followed by options and it is added by the compiler for you. You can also add your own custom line metadata to shadow lines as hashtags.

Generated from Yarn Spinner for Unity 3.3.