How do I pause the app completely when there is no activity?

45 views Asked by At

I use this -

 if (timeSinceLastClick > 60)
  {
            Time.timeScale = 0;
  }

But that doesn't freeze either the ar camera/ar tracking or audio. Besides the animation, everything else seems to keep running. I'd like to pause the app completely so the users can save their batteries and avoid heating

1

There are 1 answers

0
KYL3R On

If you want to save battery/avoid heating I'd recommend either cull as much as you can or lower the target framerate.

Settings TimeScale to 0 will affect Rigidbodies and all scripts that multiply their movements by Time.deltaTime (which is highly recommended to achieve framerate-independency). It still computes every frame, as often as possible. So see above.

If you have occlusion culling baked, you could move the camera to an area that doesn't point at any renderable objects. A dynamic cube in front of the cam will probably not work as it's not baked into Occlusion Culling. But you could disable the main Camera and render the pause-menu on a second camera that is UI only for example.