A
A
Alexander2021-06-18 18:40:09
Unity
Alexander, 2021-06-18 18:40:09

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

1 answer(s)
M
MrSlowpoke, 2021-06-18
@AlexandrG44

OnApplicationPause() is called when the player selects another application or closes the game

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question