- Home /
How do I remove action listeners from a button without actually clicking the button?
I have a UI system for an RPG where the player can press "Escape" to close any UI that is open currently but the ActionListeners of certain buttons are messing with this functionality. How can I remove ActionListeners with a hotkey instead of pressing the button and using onClick.RemoveAllListeners()?
Comment
Why can't you call button.onclick.RemoveAllListeners()
when the key is pressed ?
Your answer
![](https://koobas.hobune.stream/wayback/20220612203541im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make UI button work on HoloLens? 1 Answer
How do i make the perfect button? 1 Answer
How to create a button and delay it 0 Answers
Highlight images in buttons children 0 Answers