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

Program

A compiled Yarn program.
public class Program

Inherits from Google.Protobuf.IMessage`1

Implements Google.Protobuf.IBufferMessage

#Properties

#InitialValues

The collection of initial values for variables; if a PUSH_VARIABLE instruction is run, and the value is not found in the storage, this value will be used
public pbc::MapField<string, global::Yarn.Operand> InitialValues { get; }

Type MapField

#LanguageVersion

The version of the Yarn Spinner language that this program was compiled under.
public int LanguageVersion { get; set; }

Type Int32

#Name

The name of the program.
public string Name { get; set; }

Type String

#Nodes

The collection of nodes in this program.
public pbc::MapField<string, global::Yarn.Node> Nodes { get; }

Type MapField

#Methods

#GetVariableKind(string)

Gets a value indicating the kind of variable name represents.
public VariableKind GetVariableKind(string name)

Parameters

  • namestring
    The name of a variable.

Returns VariableKind: The kind of variable that name represents.

#LineIDsForNode(string)

Identifies and returns a list of all line and option IDs inside the node.
public List<string>? LineIDsForNode(string nodeName)

Parameters

  • nodeNamestring
    The name of the node whos line IDs you covet.

Returns List: The line IDs of all lines and options inside the node, or null if nodeName doesn't exist in the program.

#ToString()

public override string ToString()

Returns String

#TryGetInitialValue<T>(string, T)

Attempts to fetch a value for a variable named variableName from this program's collection of initial values.
public bool TryGetInitialValue<T>(string variableName, out T result)

Type Parameters

  • T
    The type of variable to retrieve.

Parameters

  • variableNamestring
    The name of the variable to retrieve a value for.
  • resultT
    On return, contains the value of the variable, or the default value of T if not known. Depending on what T is, this value may be null.

Returns Boolean: true if an initial value for variableName was found; false otherwise.

Exceptions

  • System.InvalidOperationException
    Thrown the stored initial value found for variableName is not known to this version of Yarn Spinner.
  • System.InvalidCastException
    Thrown when the initial value found for variableName cannot be cast or converted to T.

Generated from Yarn Spinner for Unity 3.3.