on button hover box shows

Hi, i was wondering how i can code so if someone have theirs mouse over a button it shows a GUI Box and a GUI Button? hope to get a nice reply

Thanks

This is sample code for Mouse Over Mesh Or Button

 using UnityEngine;

 using System.Collections;

 public class Example : MonoBehaviour 
 {

        public bool boolMouseOver = false ;

        void OnMouseOver() // This Function for  Mouse Over a Mesh or GUIContent
        {

            boolMouseOver = true;

        }

       void OnMouseExit() // This Function for  Mouse Not Over a Mesh or GUIContent
        {

	       boolMouseOver = false;

        }

      void OnGUI()
     {
	  GUI.depth = -10;
	
	  GUI.Button(new Rect(10, 10, 100, 20), new GUIContent("Click me", "Mouse Over Button")); // When Mouse Over this button GUI.tooltip = "Mouse Over Button"
	
	
	  if(GUI.tooltip =="Mouse Over Button")
	  {
		boolMouseOver = true;
	  }
	  else
	  {
		boolMouseOver = false;
	  }
   

	  if(boolMouseOver == true)
	  {
		GUI.Box (new Rect(500,100,100,50) ,"Here is a box");
		
		GUI.Box (new Rect(100,100,100,50) ,"Here is a Button");
		
	  }
}

For More details about Mouse Over read this link

there’s some functions you can use for to detect input Functions.
I got two solutions for this:

  1. you get the mouse position and see if it is in the button area.
  2. use collider and raycast to detect if the user hover upon the button.
    Then you can shows the GUI Box(Button).