Sleeptimeout example script for unity 3d 3.4?

I’m into android game developing. Everything was going smooth till this sleeptimeout thing came…
The game I’m developing is all accelerometer controlled. I need to keep the screen turned on when the user is playing.
I used the following script named ‘SleepTime.js’ to control the Time till the screen goes to sleep -

function Start () {
Screen.sleepTimeout = 0.0f;

But this code doesn’t seem to work at all!
P.S- I am using unity 3d 3.4.

If you want to keep the screen active at all times, you have to use:

Screen.sleepTimeout = SleepTimeout.NeverSleep;

You can find the documentation here: