DismissLine(Action)

Method in LineView

Summary

Called by the DialogueRunner to signal that the view should dismiss its current line from display, and clean up.

public override void DismissLine(Action onDismissalComplete)

Remarks

This method is called when all Dialogue Views attached to a Dialogue Runner report that they have finished presenting this line. When this occurs, the Dialogue Runner calls DismissLine(Action) on all Dialogue Views to tell them to clear their current line from display.

Depending on how the Dialogue View presents lines, "dismissing" a line may mean different things. For example, a Dialogue View that presents on-screen text might fade the text away, or a Dialogue View that presents voice-over dialogue may not need to do anything at all (because audio finished playing when the line finished presenting.)

Dismissing the line can take time, but should ideally be as fast as possible, because the user will be waiting for the next piece of content to appear.

When the line has finished dismissing, this method calls onDismissalComplete to indicate that the dismissal is complete. When all Dialogue Views on a Dialogue Runner have finished dismissing, the Dialogue Runner moves on to the next piece of content.

The default implementation of this method immediately calls the onDismissalComplete method (that is, it reports that it has finished dismissing the line the moment that it receives it), and otherwise does nothing.

Parameters

NameDescription

System.Action onDismissalComplete

The method that should be called when the view has finished dismissing the line.

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.