How can i catch user pressing Cmd-Q, and hook it up to the event, instead of instant quiting? It seems OnApplicationQuit() and Application.CancelQuit() is not helping here.
GetKeyDown only returns true for the frame that the key is actually pressed down. However, I’m not sure why you’re checking for that at all, particularly since that wouldn’t cover quitting from the menu (or Windows builds)…I would think you’d just do
But how should i quit application in that case? I just want to display “Quit? Yes/No” menu on Esc and Cmd-Q, but if player pressed “Yes”, i need actually quit (use Application.Quit()). But wouldn’t it invoke OnApplicationQuit() again?