So, I have my inventory appear when I press the Tab key. It also disappears when I press the Tab key again.
Is there a good way to make it also disappear when the mouse leaves the menu?
I ask because I don't want the player to have to hit tab again after having chosen an inventory item to use on something on the scene, it's an extra redundant step I'd like to eliminate.
Comments
Say your menu's called "Inventory":
Menu inventoryMenu = PlayerMenus.GetMenuWithName ("Inventory");
PlayerInput playerInput = GameObject.FindWithTag (Tags.gameEngine).GetComponent ();
if (inventoryMenu.GetRect ().Contains (playerInput.GetInvertedMouse ())
{
inventoryMenu.TurnOff (true);
}