# DialogueCharacterNameView

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

Inherits from [`DialogueViewBase`](/2.2/api/csharp/yarn.unity/yarn.unity.dialogueviewbase.md)

## Summary

A subclass of [DialogueViewBase](/2.2/api/csharp/yarn.unity/yarn.unity.dialogueviewbase.md) that displays character names.

```csharp
public class DialogueCharacterNameView : Yarn.Unity.DialogueViewBase
```

## Remarks

This class uses the `character` attribute on lines that it receives to determine its content. When the view's [RunLine(LocalizedLine,Action)](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguecharacternameview/yarn.unity.dialoguecharacternameview.runline.md) method is called with a line whose [Text](/2.2/api/csharp/yarn.unity/yarn.unity.localizedline/yarn.unity.localizedline.text.md) contains a `character` attribute, the [onNameUpdate](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguecharacternameview/yarn.unity.dialoguecharacternameview.onnameupdate.md) event is fired. If the line does not contain such an attribute, the [onNameNotPresent](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguecharacternameview/yarn.unity.dialoguecharacternameview.onnamenotpresent.md) event is fired instead.

This view does not present any options or handle commands. It's intended to be used alongside other subclasses of DialogueViewBase.

## Fields

| Name                                                                                                                                           | Description                                                                                         |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [onDialogueStarted](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguecharacternameview/yarn.unity.dialoguecharacternameview.ondialoguestarted.md) | Invoked when the dialogue is started.                                                               |
| [onNameNotPresent](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguecharacternameview/yarn.unity.dialoguecharacternameview.onnamenotpresent.md)   | Invoked when a line is received that doesn't contain a character name.                              |
| [onNameUpdate](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguecharacternameview/yarn.unity.dialoguecharacternameview.onnameupdate.md)           | Invoked when a line is received that contains a character name. The name is given as the parameter. |

## Methods

| Name                                                                                                                                             | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| [DialogueStarted()](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguecharacternameview/yarn.unity.dialoguecharacternameview.dialoguestarted.md)     |             |
| [RunLine(LocalizedLine,Action)](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguecharacternameview/yarn.unity.dialoguecharacternameview.runline.md) |             |

## See Also

* DialogueUI


---

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