- Home /
Android fullscreen change
Good afternoon. How to deliver in case of an application launch on Android the fullscreen=false mode; At me it is written so (the script is attached to the camera, the first scene after splash screen boots):
void Start() {
Screen.fullscreen = false;
}
Unfortunately, it doesn't work (I checked on logs and I created GUI on the screen). But if I after pass into other scene and from it I return to the first (where I change the fullscreen mode as I wrote above), the mode of the screen changes. Prompt please how to deliver the fullscreen mode in false status in the first scene after its loading? (All this becomes for device Android)
Answer by Sisso · Jan 15, 2014 at 01:17 PM
Probably you need to go into android plugins, customize your manifest and/or UnityPlayerActivity.
Tips:
Read plugin manual
http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html
Search for tutorials:
Try to search for "unity3d customize android activity".
Read default activity:
Unity/Editor/Data/PlaybackEngines/androidplayer/src/com/unity3d/player/UnityPlayerNativeActivity.java
@Sisso Idea to create own plug-in, of course, the good. Finally it is necessary for me that the buttons back, home, etc. on the android were visible. The simplest method, it to deliver the fullscreen mode in false status. If to move my code to the Update function, everything works perfectly. Problem on initial stage to loading of application and as to correct it I don't know. Whether is it possible to make it as Start or Awake?
Ok... sometime I read fast and lose some important comments, sorry. It works sometimes.
There is a important note in Screen.fullScreen help.
"A fullscreen switch does not happen immediately; it will actually happen when the current frame is finished."
This property could have some crazy dependecy with frame? I think that Start and Awake are called before render the first time if they are already in scene. This could explain why it only work in Update.
Have you tried to change (http://docs.unity3d.com/Documentation/ScriptReference/PlayerSettings-defaultIsFullScreen.html) before build? The doc are not very helpfull but it could work.
@Sisso Unfortunately I tried different combinations. I have Unity 4.1.2. So can in later versions and there is for the Android fullscreen flag activation in ProjectSettings. But in this version isn't present. (And while I don't intend to transfer to higher Unity versions). When writing Screen.fullscreen=false as Start and project compiling for Windows no problems arise. Unfortunately such behavior is shown only for the Android of a platform. Probably, it is connected somehow to Splash screen. Option at me while only one - to transfer a code to the Update function and to check a screen mode. The first scene at me is an initial menu therefore there it is possible such to make.