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

Compiler

Compiles Yarn code.
public static class Compiler

Inherits from System.Object

#Methods

#Compile(CompilationJob)

Compiles Yarn code, as specified by a compilation job.
public static CompilationResult Compile(CompilationJob compilationJob)

Parameters

Returns CompilationResult: The results of the compilation.

See also

#FlattenParseTree(IParseTree)

Flattens a tree of IParseTree objects by recursively visiting their children, and converting them into a flat System.Collections.Generic.IEnumerable`1.
public static IEnumerable<IParseTree> FlattenParseTree(IParseTree node)

Parameters

  • nodeIParseTree
    The root node to begin work from.

Returns IEnumerable: An System.Collections.Generic.IEnumerable`1 that contains a flattened version of the hierarchy rooted at node.

#GetDocumentComments(CommonTokenStream, ParserRuleContext, bool)

Gets the text of the documentation comments that either immediately precede context, or are on the same line as context.
public static string? GetDocumentComments(CommonTokenStream tokens, ParserRuleContext context, bool allowCommentsAfter = true)

Parameters

  • tokensCommonTokenStream
    The token stream to search.
  • contextParserRuleContext
    The parser rule context to get documentation comments for.
  • allowCommentsAfterbool
    If true, this method will search for documentation comments that come after context's last token and are on the same line.

Returns String: The text of the documentation comments, or null if no documentation comments were present.

Documentation comments begin with a triple-slash (///), and are used to describe variable declarations. If documentation comments precede a declaration (that is, they're not on the same line as the declaration), then they may span multiple lines, as long as each line begins with a triple-slash.

#GetLineIDForNodeName(string)

Generates a line id for a raw text node
public static string GetLineIDForNodeName(string name)

Parameters

  • namestring
    The name of the node

Returns String: line id for the raw text node

This should only be used when in raw text mode.

Generated from Yarn Spinner for Unity 3.3.