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

CompilationJob

An object that contains Yarn source code to compile, and instructions on how to compile it.
public struct CompilationJob

Inherits from System.ValueType

Instances of this struct are used with Compile(CompilationJob) to produce CompilationResult objects.

#Nested Types

  • File class
    Represents the contents of a file to compile.
  • Raw class
    Represents a string being passed in directly for the compiler to use. This is in constrast to loading it from a file. Mostly used internally for testing.
  • Type enum
    The type of compilation that the compiler will do.

#Fields

#CompilationType

The type of compilation to perform.
public Type CompilationType;

Type Type

#Declarations

The declarations for variables and functions.
public IEnumerable<Declaration> Declarations;

Type IEnumerable

#Inputs

Collection of all the inputs that have been provided to the compilation job
public IEnumerable<ISourceInput> Inputs;

Type IEnumerable

#Properties

#CancellationToken

A cancellation token that can be used to signal that the compilation should be cancelled.
public CancellationToken CancellationToken { get; set; }

Type CancellationToken

#DiagnosticSeverities

A dictionary mapping diagnostic codes to overridden diagnostic severities.
public IDictionary<string, Diagnostic.DiagnosticSeverity>? DiagnosticSeverities { get; internal set; }

Type IDictionary

#Files Obsolete

Use Inputs

The File structs that represent the content to parse..
public IEnumerable<File> Files { get; }

Type IEnumerable

#LanguageVersion

Gets or sets the version of the Yarn language.
public int LanguageVersion { get; set; }

Type Int32

#TypeDeclarations

The collection of type declarations that should be imported and made available to the compiler, prior to compilation.
public IEnumerable<IType>? TypeDeclarations { get; set; }

Type IEnumerable

#VariableDeclarations Obsolete

Use Declarations

The declarations for variables.
public IEnumerable<Declaration> VariableDeclarations { readonly get; set; }

Type IEnumerable

#Methods

#CreateFromFiles(IEnumerable<string>)

Creates a new CompilationJob using the contents of a collection of files.
public static CompilationJob CreateFromFiles(IEnumerable<string> paths)

Parameters

  • pathsSystem.Collections.Generic.IEnumerable<string>
    The paths to the files.

Returns CompilationJob: A new CompilationJob.

#CreateFromFiles(string[])

Creates a new CompilationJob using the contents of a collection of files.
public static CompilationJob CreateFromFiles(params string[] paths)

Parameters

  • pathsstring[]
    The paths to the files.

Returns CompilationJob: A new CompilationJob.

#CreateFromInputs(IEnumerable<ISourceInput>, IEnumerable<Declaration>?, int)

Creates a new CompilationJob using the contents of a collection of source inputs.
public static CompilationJob CreateFromInputs(IEnumerable<ISourceInput> inputs, IEnumerable<Declaration>? declarations = null, int languageVersion = Project.CurrentProjectFileVersion)

Parameters

  • inputsSystem.Collections.Generic.IEnumerable<Yarn.Compiler.ISourceInput>
    The inputs to the compilation.
  • declarationsSystem.Collections.Generic.IEnumerable<Yarn.Compiler.Declaration>
    Any external declarations necessary for the compilation
  • languageVersionint
    The version of the Yarn language and project

Returns CompilationJob: A new CompilationJob.

#CreateFromProject(Project)

Creates a new CompilationJob using the contents of a Project as it's input
public static CompilationJob CreateFromProject(Project project)

Parameters

Returns CompilationJob

#CreateFromProject(string)

Creates a new CompilationJob using the contents of a Project as it's input
public static CompilationJob CreateFromProject(string projectPath)

Parameters

  • project(unknown)
    The project to use for compilation
  • projectPathstring

Returns CompilationJob

#CreateFromString(string, string, IEnumerable<Declaration>?, int)

Creates a new CompilationJob using the contents of a string.
public static CompilationJob CreateFromString(string inputName, string source, IEnumerable<Declaration>? declarations = null, int languageVersion = Project.CurrentProjectFileVersion)

Parameters

  • inputNamestring
    The name to assign to the compiled file.
  • sourcestring
    The text to compile.
  • declarationsSystem.Collections.Generic.IEnumerable<Yarn.Compiler.Declaration>
    Any external declarations necessary for the compilation
  • languageVersionint
    The version of the Yarn language to use.

Returns CompilationJob: A new CompilationJob.

Generated from Yarn Spinner for Unity 3.3.