Hello so i was gonna design my menu for my game and wanted so if someone have their mouse over a button its shows a gui box with 3 or 4 buttons in it but i cant figure how i can doe so if people move the mouse to the gui box than it doesent dissapear here is my code:
public bool boolMouseOver = false;
GUI.Button(new Rect(Screen.width / 2 - 380, Screen.height / 2 - 130, 200, 50), new GUIContent("MENU", "Mouse Over Button"), style);
if (GUI.tooltip == "Mouse Over Button")
boolMouseOver = true;
else
boolMouseOver = false;
if (boolMouseOver == true)
{
GUI.Box(new Rect(Screen.width / 2 - 180, Screen.height / 2 - 130, 220, 300), new GUIContent("", "Mouse Over Button"));
if (GUI.Button(new Rect(Screen.width / 2 - 160, Screen.height / 2 - 125, 180, 40), "1", style))
{
audio.PlayOneShot(buttonsound);
}
if (GUI.Button(new Rect(Screen.width / 2 - 160, Screen.height / 2 - 75, 180, 40), "2", style))
{
audio.PlayOneShot(buttonsound);
}
if (GUI.Button(new Rect(Screen.width / 2 - 160, Screen.height / 2 - 25, 180, 40), "3", style))
{
audio.PlayOneShot(buttonsound);
}
}