YarnSpinnerTool / YarnSpinner-Unity

The official Unity integration for Yarn Spinner, the friendly dialogue tool.
MIT License
522 stars 91 forks source link

possibility to add numbers to the options displayed text & select opt… #269

Open praschl opened 9 months ago

praschl commented 9 months ago

This commit adds the possibility to give each option a number, like "1. Yes sure" "2. Maybe" "3. No definitly not"

The numbers are generated automatically for available options, when the addNumbersToOptions flag is true.

It also adds two methods that can be used to simulate the selection of the options by code. I am using it like this in my project where I have the "New Input System" set up so the user can press 1-5 on the keyboard to select an option. This will not click the buttons, so I need a way to select them by code when the key is pressed. The second method always selects the last displayed option.

If this is a change you would accept, I will also write the required tests, docs etc, before you actually merge it, of course. Just want to make sure the feature itself (and its implementation) is acceptable before I go through that :-)

regards, Michael