Closing a browser

Hi.

I’m making an online game. I want to have a quit button on the main menu so that if the player clicks it the browser window be closed. Could you please help me and give the code for it?

I used this one, but it didn’t do anything.

var isQuitButton = false;

function OnMouseUp()

{

if(isQuitButton)

{

 Application.Quit();

}

}

Thanks for help.

That can’t be enforced by the UnityWebplayer. Usually people uses tabs nowadays, so closing a window without permission is something which lays outside of what the webplayer should be able to do.

However, if the user allows a webpage to close a window via javascript you can do it that way. Take a look at Application.ExternalEval and for more information on window.close see this page