Comment on page
public virtual void RunOptions(DialogueOption dialogueOptions, Action<int> onOptionSelected)
This method is called when the Dialogue Runner wants to show a collection of options that the user should choose from. Each option is represented by a DialogueOption object, which contains information about the option.
When this method is called, the Dialogue View should display appropriate user interface elements that let the user choose among the options.
After calling the
onOptionSelectedmethod, the Dialogue View should dismiss whatever options UI it presented. The Dialogue Runner will immediately deliver the next piece of content.
When the Dialogue Runner delivers Options to its Dialogue Views, it expects precisely one of its views to call the
- If your scene includes no dialogue views that override RunOptions(DialogueOption,Action<int>), the Dialogue Runner will never be told which option the user selected, and will therefore wait forever.
- If your scene includes multiple dialogue views that override RunOptions(DialogueOption,Action<int>), they will all receive a call each time the dialogue system presents options to the player. You must ensure that only one of them calls the
The default implementation of this method does nothing, and does not call the
onOptionSelectedmethod (that is, it ignores any Options it receives.)