Managing State and Input in Unity

Greetings

My team and I are developing a visualization application using Unity. We are about to design the user interface and user experience and I wanted to ask other Unity users if they had any best practices that the employ when managing input state.

For example: We’re in the 3D portion of our application and we press F10 to open a menu. What is the best way to focus solely on that menu and block all other input until that menu is closed?

Another example: We want to use drop down menus such as those seen in Windows (File, Edit, Assets, etc). What is the most efficient way to make sure that drop down rolls back up if I open it and then change my mind and click somewhere else?

I’ve read some thoughts on the forums here about having all of your input go through a manager or having a script on every clickable object that checks a manager the see whether it can respond to input. Some even suggest extending and modifying the Standard Input Module. Does anyone have any practical experience using such methods? Or better ways to manage state and input in Unity?

Thanks.

I typically use two methods in combination.

A manager class can be used to track the current menu and store the previous menus. This allows for the user to negotiate backwards easily.

Then I’ll put an invisible UI object behind each menu and use that to block input to the rest of the game, as well as detect off menu clicks.