Answer the question
In order to leave comments, you need to log in
How to understand that the game is out?
Greetings, I have a system: if music plays in the game (musicPlaying == 1, the object on which the script is DontDestroyOnLoad), went to another level, returned to the menu, the music does not start from the beginning (continues to play). But if, to exit the game, the value will be that the music is playing (but not actually playing), and will not let the music start ("Well, it's playing, but it's worth it").
Game for Android. It will not work to "hang" 0 on the exit button, because. often in mobile games, the player himself "throws out" the application from the processes, and on a PC you can do this.
Answer the question
In order to leave comments, you need to log in
OnApplicationPause() is called when the player selects another application or closes the game
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question