For visual reasons, I need to use a GUI.Toggle (instead of a GUI.Button) to trigger an event that happens just once. What I’m using is this:
myBool = GUI.Toggle (Rect (129, 22, 31, 30), myBool, myIcon);
if (GUI.changed myBool == true) {
do something;
}
This works as long as the user clicks anywhere but on a GUI element. The problem is when the user clicks anywhere in the GUI. I just want it to happen when this particular GUI.Toggle is clicked. Any ideas?