Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Demigoth on March 26, 2014, 08:07:47 PM
-
Hey guys, so I am working on my game and got this menu show up when I click an in-game object, now the menu wont dissapear until I actually use the stuff its inside, but I wanted to know if there is any way to trigger it to hide when I click outside of it.
-
If you give your menu focus via UICamera.selectedObject = yourMenuObject, you can then detect when it loses focus as it will receive OnSelect(false), letting you close it. That's what the popup list does as well.
-
Hey Aren,
but where do I put this script on, to set up the focus.
-
On whatever object you want to hold focus while the menu is visible -- likely the menu itself.