What I am trying to do is to detect when my mouse hovers over a GUI button.
My code looks something like this
string hover;
void OnGUI(){
if (GUI.Button(button1, new GUIContent("1 Block", "1 Block")))
//do stuff
if (GUI.Button(button1, new GUIContent("2 Block", "2 Block")))
//do other stuff
hover = GUI.tooltip;
}
void Update () {
if(hover=="1 Block")
//mouse is hovering over 1 block
}
Now this works completely fine when the mouse is hovering over it but during the moments the mouse is clicked, hover is equal to null. (checked with Debug.Log)
any ideas?