New to the forums? Click here to read the "How To" Guide.

Developer? Click here to go to the Developer Forums.

Disable OVR sleep?

demodern2demodern2 Posts: 5
NerveGear
Hi everyone,
I'm working on a VR app in unity, been using the dk2 so far, switched to cv1 today (yay!) and finally got it to run as expected.

One problem I have encountered though, is when the light sensor in the goggle sends it to "sleep mode", effectively pausing the running exe. I need to disable this feature, since my exe already tracks user inactivity (no more LocalRotation for a couple of seconds) but it obviously can't do that when it's paused... I've been digging through a lot of supplied ovr code, but cannot find anything.

So, the question is: how can I disable this standard behaviour? The goggle itself going to sleep is fine, just not the pausing of the exe...

Cheers,
tobe
Tagged:

Answers

  • BajBaj Posts: 21
    Brain Burst
    A temp fix would be to stick something over the sensor.
  • demodern2demodern2 Posts: 5
    NerveGear
    A little late, but maybe this helps if someone has a similar problem with inactivity:
    I switched to using OnApplicationPause together with Time.realtimeSinceStartup to get the time passed when the app returns from sleep.
    It's a bit silly to test in-editor since you have to tab out and back to simulate pause / resume, but it definitely works reliably for a standalone build.

    float lastUserTime = 0;
    // app deactivated by rift's light sensor void OnApplicationPause(bool appIsPaused) { if (appIsPaused) { // we are in background Debug.LogError("# # # # app paused!"); lastUserTime = Time.realtimeSinceStartup; } else { // we are in foreground again. Debug.LogError("# # # # app resumed! -> time passed: " + (Time.realtimeSinceStartup - lastUserTime)); } }
Sign In or Register to comment.