How to implement "screenCanDarken"

To prevent iPhone/iPad from dimming, I found this doc (
http://unity3d.com/support/documentation/ScriptReference/iPhoneSettings-screenCanDarken.html), but how to I use the feature? Do I make a javascript that contains it? bind the script to a gameobject in every level?

advice is appreciated :slight_smile:

Nah, it’s a static variable, you only set it once at the first script your game runs when it starts up. Add it somewhere in that script’s Start/Awake/OnEnable/Whatever function.

Unity 3.4 cut it actually, replacing it basically with Screen.sleepTimeout

this gives you much more control, 0 means the same as canDarken = false before, but anything else actually gives you a timeframe till dim, important for pause menues etc

Thanks for the tip dreamora.