Unity 禁止屏幕变黑

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;

转载于:https://my.oschina.net/8453466/blog/733048

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值