Android / iOS - screen Brightness and preventing Screen Blockade.

Hey, I’m making a small application for Android and iOS.

I need to turn up the phone/tablet screen brightness and prevent the screen from blocking (when idle). How can I do that through script (C#/JS) ?

To prevent the screen from going to sleep, Unity gives you:

Screen.sleepTimeout = SleepTimeout.NeverSleep;

Unity has no built-in ability to control the screen brightness, which is where Dimmer comes to the rescue:

It works for both iOS and Android and lets you turn the screen brightness up to maximum, regardless of how the user has set the brightness in the device settings.

You can use a script to control it, or if you want to set brightness to maximum at the start of your application and then not touch it, you don’t need any code - just add the component and give it these settings in the inspector: