Probably I am overworked but that bug that I’m having is very wierd.
I draw stuff in rectangles:
void OnGUI ()
{
GUI.Label (headlineRect, "HEADLINERECT", headlineStyle);
GUI.Label (buttonRect, "BUTTONRECT", headlineStyle);
}
void Update ()
{
if (buttonRect.Contains (Input.mousePosition) && Input.GetMouseButtonDown (0)) {
doStuff()...
}
}
Seems legit to me. The Rectangles are created in Start(). Doesnt even matter because I can see the two labels in the game.
Now when I click the “BUTTONRECT” text in game nothing happens. But when I click the “HEADLINERECT” text, doStuff() happens.
I am using version 4.3.4 I tried to restart unity. When I change the buttonrect in update() to headlineRect it works like it should.