Discussions
Sign In
Forum rules
- please read before posting.
Pause in background
tinchopunk
July 2018
in
Technical Q&A
Is there any option that when you minimize the window game, pause the game.
Becouse now continue playing in the background.
Thanks
Comments
Keks
July 2018
edited July 2018
It's in
Player Settings
, the
Run In Background
option.
Check the manual, i suppose that's what are you looking for.
https://docs.unity3d.com/Manual/class-PlayerSettingsStandalone.html
tinchopunk
July 2018
Yes, that was my first look but I had unchecked. My idea is when you minimize active the pause menu.
Keks
July 2018
edited July 2018
Maybe the
OnApplicationFocus()
could do the trick?
https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationFocus.html
ChrisIceBox
July 2018
Indeed - an OnApplicationFocus call is necessary, the "Run In Background" is a separate feature.
AC can be paused through script:
AC.KickStarter.sceneSettings.PauseGame ();
AC.KickStarter.sceneSettings.UnpauseGame ();
However, this might be useful as an official option - I'll look into it further.
ChrisIceBox
July 2018
Here's a test script to try out, how does it go?
http://pasteall.org/1031708/csharp
tinchopunk
July 2018
Just work really good.
Sign In
or
Register
to comment.
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Quick Links
Categories
Recent Discussions
Categories
11.7K
All Categories
63
Official news
1.4K
Engine development
9.7K
Technical Q&A
305
Games showcase
149
Extending the editor
216
Adventure talk
Welcome to the official forum for Adventure Creator.
Forum rules
Main website
Store page
Community wiki
Community Discord
Powered by Vanilla
Comments
Check the manual, i suppose that's what are you looking for.
https://docs.unity3d.com/Manual/class-PlayerSettingsStandalone.html
https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationFocus.html