public static int sleepTimeout ;

Description

节能设置,允许屏幕在无用户交互一段时间后变暗。

最适合用于手持设备, 以帮助操作系统以最有效的方式延长电池使用时间。在非手持设备上 不执行任何操作。

sleepTimeout 以秒为单位进行测量。默认值因平台而异, 通常为非零值。

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.

using UnityEngine;

public class Example : MonoBehaviour { void Start() { // Disable screen dimming Screen.sleepTimeout = SleepTimeout.NeverSleep; } }

另请参阅:SleepTimeout