DialogueViewBase
Class in Yarn.Unity
Inherits from MonoBehaviour
Summary
A MonoBehaviour
that can present lines and options to the user, when it receives them from a DialogueRunner .
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 views stored in dialogueViews. The Dialogue Runner then waits until all Dialogue Views have reported that they have finished presenting the content.
To use this class, subclass it, and override its methods. Some of the more common methods you may wish to override are: RunLine(LocalizedLine,Action), InterruptLine(LocalizedLine,Action), DismissLine(Action) and RunOptions(DialogueOption[],Action<int>).
Once you have written your subclass, attach it as a component to a GameObject
, and add this game object to the list of Dialogue Views in your scene's DialogueRunner.
Dialogue Views do not need to handle every kind of content that the Dialogue Runner might produce. For example, you might have one Dialogue View 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 Views that handle the same kind of content. For example, you may have a Dialogue View that receives Lines and uses them to play voice-over audio, and a second Dialogue View that also receives Lines and uses them to display on-screen subtitles.
Fields
Represents the method that should be called when this view wants the line to be interrupted.
Methods
See Also
LineProviderBehaviour: A
MonoBehaviour
that produces LocalizedLine s, for use in Dialogue Views.DialogueRunner.dialogueViews: The View classes that will present the dialogue to the user.
Last updated
Was this helpful?