Button inside a window not responding!
I have a button inside a window. The button is showing, it is not responding to clicks! Here is the code:
void OnGUI()
{
useGUILayout = true;
GUI.skin = mainSkin;
if (showWindow) GUI.DragWindow (2, new Rect (Screen.width / 2 - windowWidth / 2, Screen.height / 2 - windowHeight / 2, windowWidth, windowHeight), Yoyo, "NOTICE");
} // end of OnGUI
void Yoyo(int winID)
{
GUI.BringWindowToFront(winID);
GUI.FocusWindow(winID);
if (GUI.Button (new Rect (windowWidth / 2 - buttonWidth / 2, windowHeight - buttonHeight + 50, buttonWidth, buttonHeight), "OKAYss"))
{
// doesn't work :(
showWindow = false;
print ("got a click");
} // end of if
GUI.UnfocusWindow();
} // end of Yoyo
Comment
Answer by Cuttlas-U · Apr 08, 2017 at 10:59 AM
Hi that's the old system and don't remember it much , the only thing that i remember is that if the button scale be negative it wont work ,
so check it out
Your answer
Follow this Question
Related Questions
Images as buttons with GUI skins 1 Answer
what replaces Toggle Using Button Style in New GUI? 1 Answer
How do I change Buttons location in script? 1 Answer
how to make a button make an image show inside another button 1 Answer
how to make one button disappear if i click another button unity 1 Answer