I wrote below script and I think unity got a bug.
public class GUITextureScript: MonoBehaviour {
void OnMouseEnter()
{
Debug.Log(“OnMouseEnter”);
}
void OnMouseExit()
{
Debug.Log(“OnMouseExit”);
}
void OnGUI()
{
}
}
- create GUITexture GameObject
- add above script
- place mouse pointer above GUITexture gameObject and stand still
- press any key in keyboard
when doing above step OnMouseEnter() and OnMouseExit() is called according to key press by each frame.
Deleting OnGUI() declaration can fix this problem but OnGUI() fuctnion declared in another script reproduce OnMouseEnter bug.
Is anybody help me out?
I’m not english speaker and I hope you to be understood my question.