Alright so what i’m trying to do is make GUI.Window components that do something when clicked, but i have no idea how to make it work.
Here’s what i got so far:
GUI.WindowFunction winFunction;
Rect r = new Rect(30, 30, 300, 300);
void Start(){
winFunction = windowFunction;
}
void OnGUI(){
GUI.Window(0, r, winFunction, "test");
}
void windowFunction(int windowID){
//One of the things i've tried, doesn't work for some reason.
if(Input.GetMouseButtonDown(0) && r.Contains(Input.mousePosition))
{
print("doesnt work");
}
}
Any ideas how to make it work? besides perhaps using reflection.