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).

OptionItem

Represents a single item (so a choice that can be made) in a group of options. Is used by the OptionsPresenter to populate it's UI with choices for the player to make
public sealed class OptionItem : UnityEngine.UI.Selectable, ISubmitHandler, IPointerClickHandler, IPointerEnterHandler

Inherits from UnityEngine.UI.Selectable

Implements ISubmitHandler, IPointerClickHandler, IPointerEnterHandler

#Fields

#completionToken

Token provided by the OptionsPresenter to control if this content should be cancelled or not. Will be set cancelled if another option item is chosen.
public System.Threading.CancellationToken completionToken;

Type CancellationToken

#OnOptionSelected

public YarnTaskCompletionSource<DialogueOption?>? OnOptionSelected;

Type YarnTaskCompletionSource

#Properties

#IsHighlighted

A wrapper around the weird highlight detection of unitys UI
new public bool IsHighlighted { get; }

Type Boolean

#Option

Configures the necessary UI and async machinery of this class when given an option
public DialogueOption Option { get; set; }

Type DialogueOption

#Methods

#InvokeOptionSelected()

Handles selecting the option and passing this information back up through to the presenter
public void InvokeOptionSelected()

#OnDeselect(BaseEventData)

public override void OnDeselect(BaseEventData eventData)

Parameters

  • eventDataBaseEventData

#OnPointerClick(PointerEventData)

public void OnPointerClick(PointerEventData eventData)

Parameters

  • eventDataPointerEventData

#OnPointerEnter(PointerEventData)

public override void OnPointerEnter(PointerEventData eventData)

Parameters

  • eventDataPointerEventData

#OnSelect(BaseEventData)

public override void OnSelect(BaseEventData eventData)

Parameters

  • eventDataBaseEventData

#OnSubmit(BaseEventData)

If we receive a submit or click event, invoke our "we just selected this option" handler.
public void OnSubmit(BaseEventData eventData)

Parameters

  • eventDataBaseEventData
    the event that triggered selection

Generated from Yarn Spinner for Unity 3.3.