A browser game will still detect input from a player viewing a different tab of that browser, this is not desired and I cannot stop it.
I have a game where the player can click the screen to launch a ball (its a pong-like game). Now, if the player switches windows everything works fine (he can click freely, game is stopped), but if he only opens a different tab and clicks, the ball is launched.
I have a check that only accepts clicks withing the window area (originally because I did not want to release the ball every time the player tried to select text on the page), but if the player clicks on that area in a different tab, the problem arises.
Checking the area where the click occurred is a nice partial solution, but for a complete fix I need to be able to tell if the player can see the game window.
Note that since a new tab does not change window focus, the default Unity behavior (my window lost focus -> pause game) will not save me.
asked May 20 '10 at 09:46 PM