Screen.sleepTimeout=SleepTimeOut.NeverSleep 禁止屏幕锁屏

来源:互联网 发布:桌面特效软件 编辑:程序博客网 时间:2024/05/13 21:15

Screen.sleepTimeout


http://docs.unity3d.com/ScriptReference/Screen-sleepTimeout.html

设置屏幕锁屏时间


DescriptionA power saving setting, allowing the screen to dim some time after the last active user interaction.Most useful for handheld devices, allowing OS to preserve battery life in most efficient ways. Does nothing on non-handheld devices.sleepTimeout is measured in seconds. The default value varies from platform to platform, generally being non-zero.On mobile devices it would be useful to set sleepTimeout to [SleepTimeout.NeverSleep] for games using accelerometer as the main source of input. However, such games should allow screen dimming while in menu or paused. 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.// Disable screen dimmingScreen.sleepTimeout = SleepTimeout.NeverSleep;

SleepTimeoutclass in UnityEngineDescriptionConstants for special values of Screen.sleepTimeout.Use them to specify something other than a fixed amount of seconds before dimming the screen.Static VariablesNeverSleepPrevent screen dimming.SystemSettingSet the sleep timeout to whatever the user has specified in the system settings.



0 0
原创粉丝点击