When players closed the game in the web browser, how can I call some function?
I made the webbased game.
I need to call the method when a game player close the game.
Is there a any way to call function when a player close the window browser?
When players closed the game in the web browser, how can I call some function?
I made the webbased game.
I need to call the method when a game player close the game.
Is there a any way to call function when a player close the window browser?
Can’t understand the above is an accepted solution??
Because in a webplayer this doesn’t work :P. Chrome and I think FF terminate plugins instantly as such OnApplicationQuit will never run.
I’m running into the same problem now, check the post at the bottom from ArenMook here.
And even if it works i’m not very happy with this solution, because the player will get an annoying popup message. But probably there isn’t any other solution out there.
Also check this post.
I think i’m going with the ‘Log-out’ button, and create save points. I’m also going to create seperate saving coroutines. 1 for essential data and 1 to save everything, so I have a fast and ‘slow’ coroutine.