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

DiagnosticDescriptor

Describes a diagnostic message with a unique code and template.
public abstract class DiagnosticDescriptor

Inherits from System.Object

This class ensures that diagnostic codes and their descriptions are always paired correctly, preventing typos and mismatches. All diagnostics should be created using the predefined descriptors in this class.

#Nested Types

#Properties

#Code

Gets the unique error code for this diagnostic (e.g., "YS0001").
public string Code { get; }

Type String

#DefaultSeverity

Gets the default severity for this diagnostic.
public Diagnostic.DiagnosticSeverity DefaultSeverity { get; }

Type DiagnosticSeverity

#Description

Gets a brief description of what this diagnostic means.
public string Description { get; }

Type String

#MessageTemplate

Gets the message template for this diagnostic.
public string MessageTemplate { get; }

Type String

The template may contain placeholders like {0}, {1}, etc. for string formatting.

#MinimumSeverity

Gets the minimum severity for this diagnostic. Diagnostics produced from this descriptor may not have a severity less than this value.
public Diagnostic.DiagnosticSeverity MinimumSeverity { get; }

Type DiagnosticSeverity

#Methods

#FormatMessage(object[])

Formats the message template with the provided arguments.
public string FormatMessage(params object[] args)

Parameters

  • argsobject[]
    Arguments to format the message template with.

Returns String: The formatted message.

#GetDescriptor(string)

Gets a diagnostic descriptor by its code.
public static DiagnosticDescriptor? GetDescriptor(string code)

Parameters

  • codestring
    The diagnostic code to look up.

Returns DiagnosticDescriptor: The descriptor, or null if not found.

Generated from Yarn Spinner for Unity 3.3.