- Home /
How to Code for android phone always stay awake?
Hi! Could anyone tell how to prevent android phone from going sleep by using code? thank.
Answer by dannyskim · Jul 16, 2012 at 05:30 PM
All you had to do was simply search the Unity Script Reference for the keyword 'sleep':
http://docs.unity3d.com/Documentation/ScriptReference/30_search.html?q=sleep
Screen.sleepTimeout = (int)SleepTimeout.NeverSleep;
Can you write an example script including the variables to be defined and the function to be used for this line of code. Please?
Where is that Awake() method supposed to be? I wrote the script but now I don't know where to attach it.
Your answer

Follow this Question
Related Questions
UnityPlayerActivity vs. UnityPlayerNativeActivity 0 Answers
[ANDROID] How can this intent be made in Unity? 0 Answers
Sprites and textureformats on Android 0 Answers
Cannot touch cloned prefabs 0 Answers
Android Exception getInputStream() is not available 0 Answers