# DialogueViewBase

Class in [Yarn.Unity](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity)

Inherits from `MonoBehaviour`

## Summary

A `MonoBehaviour` that can present the data of a dialogue executed by a [DialogueRunner](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner) to the user. The [DialogueRunner](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner) uses subclasses of this type to relay information to and from the user, and to pause and resume the execution of the `YarnScript` .

```csharp
public abstract class DialogueViewBase : MonoBehaviour
```

## Remarks

The term "view" is meant in the broadest sense, e.g. a view on the dialogue (MVVM pattern). Therefore, this abstract class only defines how a specific view on the dialogue should communicate with the [DialogueRunner](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner) (e.g. display text or trigger a voice over clip). How to present the content to the user will be the responsibility of all classes inheriting from this class.

The inheriting classes will receive a [LocalizedLine](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.localizedline) and can be in one of the stages defined in `DialogueLineStatus` while presenting it.

## Methods

| Name                                                                                                                                                                     | Description                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DialogueComplete()](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialogueviewbase/yarn.unity.dialogueviewbase.dialoguecomplete)                    | Called by the [DialogueRunner](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner) to signal that the dialogue has ended, and no more lines will be delivered.         |
| [DialogueStarted()](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialogueviewbase/yarn.unity.dialogueviewbase.dialoguestarted)                      | Signals that a conversation has started.                                                                                                                                                             |
| [DismissLine(Action)](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialogueviewbase/yarn.unity.dialogueviewbase.dismissline)                        | Called by the [DialogueRunner](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner) to signal that the view should dismiss its current line from display, and clean up. |
| [NodeComplete(string,Action)](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialogueviewbase/yarn.unity.dialogueviewbase.nodecomplete)               | Called by the [DialogueRunner](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner) to signal that the end of a node has been reached.                                  |
| [OnLineStatusChanged(LocalizedLine)](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialogueviewbase/yarn.unity.dialogueviewbase.onlinestatuschanged) | Called by the DialogueRunner to indicate that the line that this view is delivering has changed state.                                                                                               |
| [ReadyForNextLine()](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialogueviewbase/yarn.unity.dialogueviewbase.readyfornextline)                    | Signals that the user wants to go to the next line.                                                                                                                                                  |
| [RunLine(LocalizedLine,Action)](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialogueviewbase/yarn.unity.dialogueviewbase.runline)                  | Called by the [DialogueRunner](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner) to signal that a line should be displayed to the user.                              |
| [RunOptions(DialogueOption\[\],Action)](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialogueviewbase/yarn.unity.dialogueviewbase.runoptions)       | Called by the [DialogueRunner](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner) to signal that a set of options should be displayed to the user.                    |

## See Also

* [DialogueRunner.dialogueViews](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity/yarn.unity.dialoguerunner/yarn.unity.dialoguerunner.dialogueviews): The View classes that will present the dialogue to the user.
* DialogueUI
