- Home /
Can I force sleepMode??
hi..
I use Unity 3.4
I want controll Device's sleepTimeout..
Screen.sleepTimeout = 0.0f;
this code is don`t sleepMode..
but I want controll time...
ex) device's SleepTime Setting is 5Min..
I want into Sleepmode at 3Min after..
Screen.sleepTimeout = 180.0f;
this code is not work...
device's SleepTime Setting is 5Min..
I want into Sleepmode at 10Min after..
Screen.sleepTimeout = 600.0f;
this code is not work...
Can I control sleepMode??
thanks..
Answer by col000r · Nov 24, 2011 at 02:45 PM
works for me.
Screen.sleepTimeout = 60f; //iPhone Screen goes to sleep after 1 min
Hmm - doesn't work on Android; docs indicate "Currently you will only be able to set this property to one of the values predefined in [SleepTimeout] class. A get will return either one of the predefined values, or the actual number of seconds until screen gets dimmed, as specified in system preferences of the device.", so I wouldn't expect it to work, either...
Your answer
![](https://koobas.hobune.stream/wayback/20220613031615im_/https://answers.unity.com/themes/thub/images/avi.jpg)