# Yarn.Unity Namespace

## Summary

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

## Attributes

| Name                                                                                | Description |
| ----------------------------------------------------------------------------------- | ----------- |
| [YarnActionAttribute](/3.1/api/csharp/yarn.unity/yarn.unity.yarnactionattribute.md) |             |

## Classes

| Name                                                                                                                              | Description                                                                                                                                                                                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.actionmarkuphandler.md)                                               | This is an abstract monobehaviour that conforms to the [IActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.md) interface.                                                                                                                                                                           |
| [ActionRegistrationExtension](/3.1/api/csharp/yarn.unity/yarn.unity.actionregistrationextension.md)                               | Contains extension methods for [IActionRegistration](/3.1/api/csharp/yarn.unity/yarn.unity.iactionregistration.md) objects.                                                                                                                                                                                                       |
| [Actions](/3.1/api/csharp/yarn.unity/yarn.unity.actions.md)                                                                       |                                                                                                                                                                                                                                                                                                                                   |
| [BuiltinLocalisedLineProvider](/3.1/api/csharp/yarn.unity/yarn.unity.builtinlocalisedlineprovider.md)                             |                                                                                                                                                                                                                                                                                                                                   |
| [Cultures](/3.1/api/csharp/yarn.unity/yarn.unity.cultures.md)                                                                     | Provides access to all [Culture](/3.1/api/csharp/yarn.unity/yarn.unity.culture.md) s supported by Yarn Spinner.                                                                                                                                                                                                                   |
| [DialogueOption](/3.1/api/csharp/yarn.unity/yarn.unity.dialogueoption.md)                                                         |                                                                                                                                                                                                                                                                                                                                   |
| [DialoguePresenterBase](/3.1/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase.md)                                           | A `UnityEngine.MonoBehaviour` that can present lines and options to the user, when it receives them from a [DialogueRunner](/3.1/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) .                                                                                                                                            |
| [DialogueReference](/3.1/api/csharp/yarn.unity/yarn.unity.dialoguereference.md)                                                   | Stores a reference to a dialogue node in a Yarn Project.                                                                                                                                                                                                                                                                          |
| [DialogueRunner](/3.1/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md)                                                         |                                                                                                                                                                                                                                                                                                                                   |
| [Effects](/3.1/api/csharp/yarn.unity/yarn.unity.effects.md)                                                                       |                                                                                                                                                                                                                                                                                                                                   |
| [GeneratedVariableStorageExtensions](/3.1/api/csharp/yarn.unity/yarn.unity.generatedvariablestorageextensions.md)                 |                                                                                                                                                                                                                                                                                                                                   |
| [InMemoryVariableStorage](/3.1/api/csharp/yarn.unity/yarn.unity.inmemoryvariablestorage.md)                                       | A simple implementation of VariableStorageBehaviour.                                                                                                                                                                                                                                                                              |
| [InputSystemAvailability](/3.1/api/csharp/yarn.unity/yarn.unity.inputsystemavailability.md)                                       |                                                                                                                                                                                                                                                                                                                                   |
| [InstantTypewriter](/3.1/api/csharp/yarn.unity/yarn.unity.instanttypewriter.md)                                                   | An implementation of [IAsyncTypewriter](/3.1/api/csharp/yarn.unity/yarn.unity.iasynctypewriter.md) that delivers all content instantly, and invokes any [IActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.md) s along the way as needed.                                                          |
| [InterfaceContainer](/3.1/api/csharp/yarn.unity/yarn.unity.interfacecontainer.md)                                                 |                                                                                                                                                                                                                                                                                                                                   |
| [LetterTypewriter](/3.1/api/csharp/yarn.unity/yarn.unity.lettertypewriter.md)                                                     | An implementation of [IAsyncTypewriter](/3.1/api/csharp/yarn.unity/yarn.unity.iasynctypewriter.md) that delivers characters one at a time, and invokes any [IActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.md) s along the way as needed.                                                       |
| [LineAdvancer](/3.1/api/csharp/yarn.unity/yarn.unity.lineadvancer.md)                                                             | A dialogue presenter that listens for user input and sends requests to a [DialogueRunner](/3.1/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) to advance the presentation of the current line, either by asking a dialogue runner to hurry up its delivery, advance to the next line, or cancel the entire dialogue session. |
| [LineMetadata](/3.1/api/csharp/yarn.unity/yarn.unity.linemetadata.md)                                                             |                                                                                                                                                                                                                                                                                                                                   |
| [LinePresenter](/3.1/api/csharp/yarn.unity/yarn.unity.linepresenter.md)                                                           | A Dialogue Presenter that presents lines of dialogue, using Unity UI elements.                                                                                                                                                                                                                                                    |
| [LinePresenterButtonHandler](/3.1/api/csharp/yarn.unity/yarn.unity.linepresenterbuttonhandler.md)                                 |                                                                                                                                                                                                                                                                                                                                   |
| [LineProviderBehaviour](/3.1/api/csharp/yarn.unity/yarn.unity.lineproviderbehaviour.md)                                           | A `UnityEngine.MonoBehaviour` that produces [LocalizedLine](/3.1/api/csharp/yarn.unity/yarn.unity.localizedline.md) s, for use in Dialogue Presenters.                                                                                                                                                                            |
| [Localization](/3.1/api/csharp/yarn.unity/yarn.unity.localization.md)                                                             |                                                                                                                                                                                                                                                                                                                                   |
| [LocalizedLine](/3.1/api/csharp/yarn.unity/yarn.unity.localizedline.md)                                                           | Represents a line, ready to be presented to the user in the localisation they have specified.                                                                                                                                                                                                                                     |
| [MarkupPalette](/3.1/api/csharp/yarn.unity/yarn.unity.markuppalette.md)                                                           | Represents a collection of marker names and colours.                                                                                                                                                                                                                                                                              |
| [OptionItem](/3.1/api/csharp/yarn.unity/yarn.unity.optionitem.md)                                                                 |                                                                                                                                                                                                                                                                                                                                   |
| [OptionsPresenter](/3.1/api/csharp/yarn.unity/yarn.unity.optionspresenter.md)                                                     | Receives options from a [DialogueRunner](/3.1/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) , and displays and manages a collection of [OptionItem](/3.1/api/csharp/yarn.unity/yarn.unity.optionitem.md) views for the user to choose from.                                                                                 |
| [PauseEventProcessor](/3.1/api/csharp/yarn.unity/yarn.unity.pauseeventprocessor.md)                                               | Allows pausing the current typewrite through \[pause/] markers.                                                                                                                                                                                                                                                                   |
| [ReplacementMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.replacementmarkuphandler.md)                                     | An attribute marker processor receives a marker found in a Yarn line, and optionally rewrites the marker and its children into a new form.                                                                                                                                                                                        |
| [SerializableDictionary](/3.1/api/csharp/yarn.unity/yarn.unity.serializabledictionary-1.md)                                       |                                                                                                                                                                                                                                                                                                                                   |
| [SerializableDictionary\<TKey, TValue>](/3.1/api/csharp/yarn.unity/yarn.unity.serializabledictionary-2.md)                        |                                                                                                                                                                                                                                                                                                                                   |
| [SerializableDictionary\<TKey, TValue, TValueStorage>](/3.1/api/csharp/yarn.unity/yarn.unity.serializabledictionary-3.md)         |                                                                                                                                                                                                                                                                                                                                   |
| [SerializableDictionaryBase](/3.1/api/csharp/yarn.unity/yarn.unity.serializabledictionarybase-1.md)                               |                                                                                                                                                                                                                                                                                                                                   |
| [SerializableDictionaryBase\<TKey, TValue, TValueStorage>](/3.1/api/csharp/yarn.unity/yarn.unity.serializabledictionarybase-2.md) |                                                                                                                                                                                                                                                                                                                                   |
| [StyleMarkerProcessor](/3.1/api/csharp/yarn.unity/yarn.unity.stylemarkerprocessor.md)                                             | An attribute marker processor that inserts TextMeshPro style tags where Yarn Spinner `[style]` tags appear in a line.                                                                                                                                                                                                             |
| [UnityEventString](/3.1/api/csharp/yarn.unity/yarn.unity.unityeventstring.md)                                                     | A `UnityEngine.Events.UnityEvent` that takes a single `string` parameter.                                                                                                                                                                                                                                                         |
| [VariableStorageBehaviour](/3.1/api/csharp/yarn.unity/yarn.unity.variablestoragebehaviour.md)                                     | A `UnityEngine.MonoBehaviour` that a [DialogueRunner](/3.1/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) uses to store and retrieve variables.                                                                                                                                                                              |
| [VoiceOverPresenter](/3.1/api/csharp/yarn.unity/yarn.unity.voiceoverpresenter.md)                                                 | A subclass of [DialoguePresenterBase](/3.1/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase.md) that plays voice-over `UnityEngine.AudioClip` s for lines of dialogue.                                                                                                                                                      |
| [WordTypewriter](/3.1/api/csharp/yarn.unity/yarn.unity.wordtypewriter.md)                                                         | An implementation of [IAsyncTypewriter](/3.1/api/csharp/yarn.unity/yarn.unity.iasynctypewriter.md) that delivers words one at a time, and invokes any [IActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.md) s along the way as needed.                                                            |
| [YarnCommandAttribute](/3.1/api/csharp/yarn.unity/yarn.unity.yarncommandattribute.md)                                             | An attribute that marks a method on an object as a command.                                                                                                                                                                                                                                                                       |
| [YarnFunctionAttribute](/3.1/api/csharp/yarn.unity/yarn.unity.yarnfunctionattribute.md)                                           | Marks the method as a function to be registered with the running instance's library.                                                                                                                                                                                                                                              |
| [YarnProject](/3.1/api/csharp/yarn.unity/yarn.unity.yarnproject.md)                                                               |                                                                                                                                                                                                                                                                                                                                   |
| [YarnTaskCompletionSource](/3.1/api/csharp/yarn.unity/yarn.unity.yarntaskcompletionsource-1.md)                                   |                                                                                                                                                                                                                                                                                                                                   |
| [YarnTaskCompletionSource](/3.1/api/csharp/yarn.unity/yarn.unity.yarntaskcompletionsource-2.md)                                   |                                                                                                                                                                                                                                                                                                                                   |
| [YarnTaskExtensions](/3.1/api/csharp/yarn.unity/yarn.unity.yarntaskextensions.md)                                                 |                                                                                                                                                                                                                                                                                                                                   |

## Enums

| Name                                                                          | Description |
| ----------------------------------------------------------------------------- | ----------- |
| [LocalizationType](/3.1/api/csharp/yarn.unity/yarn.unity.localizationtype.md) |             |
| [RegistrationType](/3.1/api/csharp/yarn.unity/yarn.unity.registrationtype.md) |             |

## Interfaces

| Name                                                                                            | Description                                                                                                                                                                                                      |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [IActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.md)           | A [IActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.md) is an object that reacts to the delivery of a line of dialogue, and can optionally control the timing of that delivery.  |
| [IActionRegistration](/3.1/api/csharp/yarn.unity/yarn.unity.iactionregistration.md)             | Contains methods that allow adding and removing Yarn commands and functions.                                                                                                                                     |
| [IAssetProvider](/3.1/api/csharp/yarn.unity/yarn.unity.iassetprovider.md)                       | Contains methods for accessing assets of a given type stored within an object.                                                                                                                                   |
| [IAsyncTypewriter](/3.1/api/csharp/yarn.unity/yarn.unity.iasynctypewriter.md)                   | An object that can handle delivery of a line's text over time.                                                                                                                                                   |
| [ICommand](/3.1/api/csharp/yarn.unity/yarn.unity.icommand.md)                                   |                                                                                                                                                                                                                  |
| [IGeneratedVariableStorage](/3.1/api/csharp/yarn.unity/yarn.unity.igeneratedvariablestorage.md) | An interface that works with [GeneratedVariableStorageExtensions](/3.1/api/csharp/yarn.unity/yarn.unity.generatedvariablestorageextensions.md) to add helper methods used by generated variable storage classes. |
| [ILineProvider](/3.1/api/csharp/yarn.unity/yarn.unity.ilineprovider.md)                         | Contains methods for retrieving user-facing localized content, given non-localized line IDs.                                                                                                                     |
| [IYarnTask](/3.1/api/csharp/yarn.unity/yarn.unity.iyarntask.md)                                 |                                                                                                                                                                                                                  |

## Namespaces

| Name                                                                            | Description                                                                       |
| ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [Yarn.Unity.Editor](/3.1/api/csharp/yarn.unity.editor.md)                       |                                                                                   |
| [Yarn.Unity.Samples](/3.1/api/csharp/yarn.unity.samples.md)                     |                                                                                   |
| [Yarn.Unity.UnityLocalization](/3.1/api/csharp/yarn.unity.unitylocalization.md) | Contains classes for working with the Unity Localization system and Yarn Spinner. |

## Structs

| Name                                                                                    | Description                                                                                               |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| [Culture](/3.1/api/csharp/yarn.unity/yarn.unity.culture.md)                             | Holds information about a language.                                                                       |
| [LineCancellationToken](/3.1/api/csharp/yarn.unity/yarn.unity.linecancellationtoken.md) | A Line Cancellation Token stores information about whether a dialogue presenter should stop its delivery. |
| [StringTableEntry](/3.1/api/csharp/yarn.unity/yarn.unity.stringtableentry.md)           |                                                                                                           |
| [YarnTask](/3.1/api/csharp/yarn.unity/yarn.unity.yarntask-1.md)                         |                                                                                                           |
| [YarnTask](/3.1/api/csharp/yarn.unity/yarn.unity.yarntask-2.md)                         |                                                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/3.1/api/csharp/yarn.unity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
