Skip to main content
Improving the title.
Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

Unity UI DropDown: Ho to How can I economically check if ita UI DropDown is open or closed?

Source Link
Rhovv
  • 1
  • 1
  • 3

Unity UI DropDown: Ho to economically check if it is open or closed

I've recently come across a problem with the UI DropDown component. I would like to resize other UI components depending on whether the dropdown is opened or closed. Unfortunately, the dropdown dynamically creates and destroys its own "Dropdown List" component, making it difficult to check whether it is open or not, without having to check with Update or FixedUpdate (both being expensive on the performance).

I have tried to implement a solution with event handlers, but it seems as if the even handler triggers before the "Dropdown List" is created. Thus this does not work.

Am I simply missing an easy way to check whether the dropdown is open or closed?