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

Yarn Spinner for Unity 3.3 API Reference

#Yarn namespace

Contains classes for working with compiled Yarn programs.

  • Command struct
    A command, sent from the Dialogue to the game.
  • Represents a property that belongs to a type and contains a read-only value.
  • Dialogue class
    Co-ordinates the execution of Yarn programs.
  • An exception that is thrown by Dialogue when there is an error in executing a Program.
  • EnumBase class
    The base type for all enumeration types.
  • EnumType class
    A type that represents enumerations.
  • A type that represents a function.
  • Header class
  • The responder is responsible for handling important dialogue events. This includes all user facing content events (such as lines and options) as well as non-usesr facing events (such as node enters and exits)
  • IMarkupParser interface
    Contains methods for parsing raw text into a MarkupParseResult.
  • Contains methods for evaluating the value of smart variables
  • IType interface
    Defines properties that describe a type in the Yarn language.
  • ITypeMember interface
    Provides properties used to work with members of a type.
  • IVariableAccess interface
    Provides a mechanism for retrieving values.
  • Provides a mechanism for storing values.
  • IYarnValue interface
    Represents a read-only value in the Yarn Spinner virtual machine.
  • Line struct
    A line of dialogue, sent from the Dialogue to the game.
  • Logger delegate
    Represents a method that receives diagnostic messages and error information from a Dialogue.
  • A simple concrete implementation of IVariableStorage that keeps all variables in memory.
  • Node class
    A node of Yarn script, contained within a Program, and containing Yarn.Instructions.
  • OptionSet struct
    A set of Options, sent from the Dialogue to the game.
  • Program class
    A compiled Yarn program.
  • Provides definitions and implementations for all the built in functions and operators
  • TypeBase class
    Provides the base class for all concrete types.
  • Types class
    Contains the built-in types available in the Yarn language.
  • Value class
    A value from inside Yarn.
  • Represents different kinds of variables that can be fetched from a Dialogue using TryGetValue<T>(string,T?).

#Yarn.Compiler namespace

Contains classes for compiling Yarn code.

  • An object that contains Yarn source code to compile, and instructions on how to compile it.
  • The result of a compilation.
  • Compiler class
    Compiles Yarn code.
  • Represents a variable declaration
  • Provides methods for constructing Declaration objects.
  • Definitions represent external actions that are part of the Project and are used in different ways by different parts of Yarn Spinner. These are primarily constructed by providing the YSLS json file but you can manually create one for tests.
  • Creates line ids in a form that attempts to approximate how a person would manually tag lines.
  • A diagnostic message that describes an error, warning or informational message that the user can take action on.
  • Describes a diagnostic message with a unique code and template.
  • Provides methods for constructing EnumType objects.
  • Contains the result of parsing a single file of source code.
  • Provides methods for constructing FunctionType objects.
  • Line tag generators are responsible for producing unique line IDs in a Yarn Spinner project.
  • A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.
  • ISourceInput interface
    An input into a Yarn Spinner compilation.
  • JumpInfo class
    information about a jump or detour from one node to another
  • type of jump between nodes
  • Contains debug information for a node in a Yarn file.
  • contains metadata about a node extracted during compilation for use by language server features this is different from nodedebuginfo which is for instruction level debugging
  • information about a shortcut option within a node
  • Contains extension methods for ParserRuleContext objects.
  • Position class
    Represents a position in a multi-line string.
  • Project class
    Yarn Projects represent instructions on where to find Yarn scripts and associated assets, and how they should be compiled.
  • Contains debugging information for compiled Yarn Projects.
  • A line tag generator that produces line IDs containing a random hexadecimal string.
  • Range class
    Represents a range of text in a multi-line string.
  • StringInfo struct
    Information about a string. Stored inside a string table, which is produced from the Compiler.
  • Utility class
    Utility methods for working with line tags.

#Yarn.Compiler.Upgrader namespace

Contains classes for upgrading Yarn code to more recent versions of the language.

#Yarn.Markup namespace

Contains classes for working with markup in Yarn lines.

#Yarn.Saliency namespace

Contains classes for choosing the most relevant content out of a set of possible options.

#Yarn.Shared namespace

  • Represents the types of actions we encounter while scanning code. Most of the time will be Command or Function
  • Represents the way the action was registered. Necessary because there are some differences in diagnostics depending on how an action has been registered.
  • ILogger interface
    Provides a common interface to logging during source gen to support any different type of logger. Technically for the source gen system but I suppose anything can use it...
  • The standard logger that is used when logging isn't necessary. This exists so that you don't have to null check every single instance of the logger.
  • Represents the type a parameter in an action can be. Is overly simplified and needs to go hand in hand with a T:Yarn.Shared.NamedType to ge fully useful but there is loads of easier filtering that can be done with this simpler representation of a type.
  • A Yarn Normalised form of the allowed return types. In Yarn a function that returns a float or an int are effectively the same thing, they both return a number. This enum represents a simpler cutdown list of those types, additionally handles when
  • Action type
    Represents the concept of a yarn action, so either a command or a function
  • Represents a parameter that is one of the basic types, so string, numbers, bools.
  • Represents a parameter that is a Unity Component subclass (often a MonoBehaviour).
  • Represents a parameter who's type and value comes from being run through a Yarn Converter attributed method.
  • Represents a more easily digestable form of the C# docstring. Intended to be used to populate the descriptions in ysls files
  • Represents a parameter that is an Enum.
  • Represents a parameter that is a Unity GameObject.
  • Specific subtype of action that represents an action that is invalid. Why it is invalid could be to any number of reasons, but this action cannot be invoked.
  • Represents a simpler and more sourcegen cache friendly version of roslyns INamedTypeSymbol. This could be a lot more advanced but in practice we've seen this works well enough to give us the necessary functionality of the roslyn equivalent.
  • Represents a single parameter inside a Yarn action.
  • Represents a parameter that is a cancellation token
  • Represents a parameter whos type either is something we can't handle in a Yarn action, or one whos conversion hasn't been resolved yet.
  • Represents the concept of a yarn converter method, what type it supports and how to call it.
  • Represents the concept of a Yarn enum including it's backing type
  • The Yarn source generator specific form of the Roslyn SpecialType. Has far less fields but we need less so it's fine.

#Yarn.Unity namespace

Contains classes for working with Yarn Spinner in the Unity game engine.

#Yarn.Unity.LineAdvancerInput namespace

#Yarn.Unity.Samples namespace

  • Detects if the render pipeline is different from the one the samples were created with, and warn you that things might look odd.

#Yarn.Unity.Shim namespace

#Yarn.Unity.UnityLocalization namespace

Contains classes for working with the Unity Localization system and Yarn Spinner.

  • Contains Yarn Spinner related metadata for Unity string table entries.
  • A line provider that uses the Unity Localization system to get localized content for Yarn lines.

#Yarn.Utility namespace

Contains utility classes used by Yarn Spinner.

  • CRC32 class
    Provides a method for generating CRC32 hashes of strings.

#Global Namespace

Generated from Yarn Spinner for Unity 3.3.