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, IPointerEnterHandlerInherits 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
eventDataBaseEventDatathe event that triggered selection
Generated from Yarn Spinner for Unity 3.3.