Screen.sleepTimeout 睡眠超时

static var sleepTimeout : float

Description描述

A 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.

省电设置,最后活跃用户交互之后,过一些时间,使屏幕变暗。对手持设备非常有用,允许操作系统保护电池最有效的办法。

sleepTimeout is measured in seconds, zero meaning never sleep. The default value varies from platform to platform, generally being non-zero on mobile devices.

sleepTimeout以秒计算,0表示不睡眠。默认值根据不同的平台而不同,一般是在移动设备上非零值。

On mobile devices it would be useful to set sleepTimeout to zero for games using accelerometer as the main source of input. However, such games should allow screen dimming while in menu or paused.

在移动设备上,为游戏设置sleepTimeout为0,使用加速度传感器作为输入的主要源。然而,此类游戏应该允许在菜单设置屏幕变暗,或暂停时。

// Disable screen dimming
//禁用屏幕变暗
Screen.sleepTimeout = 0.0f;
最后修改:2011年9月18日 Sunday 11:36

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。