Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

ActionMarkupHandler

This is an abstract monobehaviour that conforms to the IActionMarkupHandler interface.
public abstract class ActionMarkupHandler : MonoBehaviour, IActionMarkupHandler

Inherits from MonoBehaviour

Implements Yarn.Unity.IActionMarkupHandler

Intended to be used in situations where you require a monobehaviour version of the interfaces. This is used by LinePresenter to have a list of handlers that can be connected up via the inspector.

#Methods

#OnCharacterWillAppear(int, MarkupParseResult, CancellationToken)

Called repeatedly for each visible character in the line.
public abstract YarnTask OnCharacterWillAppear(int currentCharacterIndex, MarkupParseResult line, CancellationToken cancellationToken);

Parameters

  • currentCharacterIndexint
    The zero-based index of the character being displayed.
  • text(unknown)
    A TMP_Text object that the line is being displayed in.
  • cancellationTokenCancellationToken
    A cancellation token representing whether the

Returns YarnTask: A task that completes when the ActionMarkupHandler has completed presenting this character. Dialogue presenters will wait until this task is complete before displaying the remainder of the line.

This method is a ActionMarkupHandler object's main opportunity to take action during line display.

#OnLineDisplayBegin(MarkupParseResult, TMP_Text)

Called immediately before the first character in the line is presented.
public abstract void OnLineDisplayBegin(MarkupParseResult line, TMP_Text text);

Parameters

  • The line being presented.
  • textTMP_Text
    A TMP_Text object that the line is being displayed in.

#OnLineDisplayComplete()

Called after the last call to PresentCharacter(int, TMP_Text, CancellationToken).
public abstract void OnLineDisplayComplete();
This method is an opportunity for a ActionMarkupHandler to finalise its presentation after all of the characters in the line have been presented.

#OnLineWillDismiss()

Called right before the line will dismiss itself.
public abstract void OnLineWillDismiss();
This does not mean that the entirety of the view itself will have been removed, just the DialoguePresenterBase has completed displaying everything and is returning control back to the DialogueRunner to let more content flow.

#OnPrepareForLine(MarkupParseResult, TMP_Text)

Called when the line view receives the line, to prepare for showing the line.
public abstract void OnPrepareForLine(MarkupParseResult line, TMP_Text text);

Parameters

  • The line being presented.
  • textTMP_Text
    A TMP_Text object that the line is being displayed in.
This method is called before any part of the line is visible, and is an opportunity to set up any part of the ActionMarkupHandler's display before the user can see it.

Generated from Yarn Spinner for Unity 3.3.