# DialoguePresenterBase

Class in [Yarn.Unity](/api/csharp/yarn.unity.md)

Inherits from `UnityEngine.MonoBehaviour`

## Summary

A `UnityEngine.MonoBehaviour` that can present lines and options to the user, when it receives them from a [DialogueRunner](/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) .

```csharp
public abstract class DialoguePresenterBase : MonoBehaviour
```

## Remarks

When the Dialogue Runner encounters content that the user should see - that is, lines or options - it sends that content to all of the dialogue presenters stored in `DialogueRunner.dialogueViews`. The Dialogue Runner then waits until all Dialogue Presenters have reported that they have finished presenting the content.

To use this class, subclass it, and implement its required methods. Once you have written your subclass, attach it as a component to a `UnityEngine.GameObject`, and add this game object to the list of Dialogue presenters in your scene's [DialogueRunner](/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md).

Dialogue Presenters do not need to handle every kind of content that the Dialogue Runner might produce. For example, you might have one Dialogue Presenter that handles Lines, and another that handles Options. The built-in `LineView` class is an example of this, in that it only handles Lines and does nothing when it receives Options.

You may also have multiple Dialogue Presenters that handle the *same* kind of content. For example, you may have a Dialogue Presenter that receives Lines and uses them to play voice-over audio, and a second Dialogue Presenter that also receives Lines and uses them to display on-screen subtitles.

## Methods

| Name                                                                                                                                                                       | Description                                                                                                                                                     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OnDialogueCompleteAsync()](/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase/yarn.unity.dialoguepresenterbase.ondialoguecompleteasync.md)                           | Called by the [DialogueRunner](/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) to signal that the dialogue has ended, and no more lines will be delivered. |
| [OnDialogueStartedAsync()](/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase/yarn.unity.dialoguepresenterbase.ondialoguestartedasync.md)                             | Called by the [DialogueRunner](/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) to signal that dialogue has started.                                        |
| [OnNodeEnter(string)](/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase/yarn.unity.dialoguepresenterbase.onnodeenter.md)                                             |                                                                                                                                                                 |
| [OnNodeExit(string)](/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase/yarn.unity.dialoguepresenterbase.onnodeexit.md)                                               |                                                                                                                                                                 |
| [RunLineAsync(LocalizedLine,LineCancellationToken)](/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase/yarn.unity.dialoguepresenterbase.runlineasync.md)              | Called by the [DialogueRunner](/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) to signal that a line should be displayed to the user.                      |
| [RunOptionsAsync(DialogueOption\[\],CancellationToken)](/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase/yarn.unity.dialoguepresenterbase.runoptionsasync-1.md)     | Called by the [DialogueRunner](/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md) to signal that a set of options should be displayed to the user.            |
| [RunOptionsAsync(DialogueOption\[\],LineCancellationToken)](/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase/yarn.unity.dialoguepresenterbase.runoptionsasync-2.md) |                                                                                                                                                                 |

## Properties

| Name                                                                                                                 | Description |
| -------------------------------------------------------------------------------------------------------------------- | ----------- |
| [Typewriter](/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase/yarn.unity.dialoguepresenterbase.typewriter.md) |             |

## See Also

* [LineProviderBehaviour](/api/csharp/yarn.unity/yarn.unity.lineproviderbehaviour.md): A `UnityEngine.MonoBehaviour` that produces [LocalizedLine](/api/csharp/yarn.unity/yarn.unity.localizedline.md) s, for use in Dialogue Presenters.
* DialogueRunner.dialogueViews


---

# 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/api/csharp/yarn.unity/yarn.unity.dialoguepresenterbase.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.
