CharacterColorView

Class in Yarn.Unity

Inherits from AsyncDialogueViewBase

Summary

A subclass of DialogueViewBase that updates the colour of a TMPro.TMP_Text object based on the character speaking a line. names.

public class CharacterColorView : Yarn.Unity.AsyncDialogueViewBase

Remarks

This class uses the `character` attribute on lines that it receives to determine its content. When the view's RunLineAsync(LocalizedLine,LineCancellationToken) method is called with a line whose Text contains a `character` attribute, the text views have their TMPro.TMP_Text.color property updated based on the colours configured in the Inspector.

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

Classes

Name
Description

Associates a named character with a colour to use in a CharacterColorView .

Methods

Name
Description

Called by the DialogueRunner to signal that the dialogue has ended, and no more lines will be delivered.

Called by the DialogueRunner to signal that dialogue has started.

Updates the text colour of Yarn.Unity.CharacterColorView.lineTexts based on the character name of line , if any.

Called by the DialogueRunner to signal that a set of options should be displayed to the user.

Last updated

Yarn Spinnerยฎ and Secret Labยฎ are trade marks of Secret Lab Pty. Ltd., and are used by Yarn Spinner Pty. Ltd. under license.