// if the inventory is visible and the player goes out from it
{
// if an item is selected close inventory
{
btnInv.
Visible =
true;
// button to open inventory }
else
{
// otherwise if the player comes from the inventory without any selection I apply Game.Interactive = false
// so objects in the scene are not responding on mouse
}
}
// if the cursor is on the inventory
{
// Game.Interactive = true and I can interact with items
}