Very typically, you might do this somewhere
function OnGUI ()
if ( GUI.Button( Rect(20,20,50,50), "Go For It" ) ) _allez();
but somewhere else you are doing this,
function FixedUpdate()
if (Input.touchCount == 1 )
{
thisPointWorldSpace:Vector3 =
gamecam.ScreenToWorldPoint( Input.touches[0].position );
if ( something like thisPointWorldSpace.y >
fuckingButtonMarkers.position.z blah blah )
return;
_createAstoundingSpaceshipAt( thisPointWorldSpace );
}
Of course, both pieces of code get the “event”, the touch.
(I use ‘event’ in a general sense, I have no clue if .Net … or whatever this is … uses “events” or if they are nomeclatured differently, or the like.)
(This is of course very counterintuitive to say a cocoa programmer, where you have to sign-up for events, explicitly pass them on if you happen to want to, and so on.)
My hard question
(1) Can you intercept such “events” at some lower level? And then decide WTF to do with them or not do with them?
Essentially, in your button code can you more or less say “Oh, and by the way, do NOT let any one else get this touch ‘event’”.
I love and adore the slop flexibility in unity “everyone gets all events” but in a word can you bypass this or work with it?
My easier question
(2) In fact, what idiom do most people use to handle the situation described? obviously you can use a crappy boolean global or annoying little exclusion boxes or ???
Thanks for this…