InterruptLine(LocalizedLine,Action)

Method in DialogueViewBase

Summary

Called by the DialogueRunner to signal that a line has been interrupted, and that the Dialogue View should finish presenting its line as quickly as possible.

public virtual void InterruptLine(LocalizedLine dialogueLine, Action onDialogueLineFinished)

Remarks

This method is called when Dialogue Runner wants to interrupt the presentation of the current line, in order to proceed to the next piece of content.

When this method is called, the Dialogue View must finish presenting their line as quickly as it can. Depending on how this Dialogue View presents lines, this can mean different things: for example, a view that plays voice-over audio might stop playback immediately, or fade out playback over a short period of time; a view that displays text a letter at a time might display all of the text at once.

The process of finishing the presentation can take time to complete, but should happen as quickly as possible, because this method is generally called when the user wants to skip the current line.

When the line has finished presenting, the onDialogueLineFinished method must be called, which indicates to the Dialogue Runner that this line is ready to be dismissed.

When InterruptLine(LocalizedLine,Action) is called, you must not call the completion handler that RunLine(LocalizedLine,Action) has previously received - this completion handler is no longer valid. Call this method's onDialogueLineFinished instead.

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

Parameters

NameDescription

The current line that is being presented.

System.Action onDialogueLineFinished

The method that should be called after the line has finished being presented.

See Also

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.