— THIS PLUGIN IS DEPRECATED! —
I meant to write this post for a long time, but I never had the time to do it. Even if a few weeks ago I found a guy that has already posted a step by step guide to create exactly the same plugin, I decided to do my own version and publish an app to show you the final result and, maybe, help you to save money.
Brandon’s tutorial was very easy to follow (Click here to see his post) and thanks to him I built this plugin that everyone can immediately use for free! 🙂
Download the app below that will demonstrate how to enable and disable the Immersive Mode screen in Unity.
This will allow you to show in full screen your game!!!
Add it on your project:
Download the zip file, inside you’ll find the AndroidManifest.xml and immersivemode.jar and drag them and in your project under PlugIns/Android/
If you have already your own Manifest.xml you just need to update the following line:
If you want the game to start in Immersive Mode you have to use:
com.daniel4d.immersivemode.MainActivityImmersive
If you don’t want to start in Immersive Mode, you can use:
com.daniel4d.immersivemode.MainActivity
To enable or disable the Immersive Mode during the game, you can use the following code in Unity (C#):
using (AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {using (AndroidJavaObject obj_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>("currentActivity")) {obj_Activity.Call("ActivateImmersiveMode");}}
Using “ActivateImmersiveMode” or “DeactivateImmersiveMode”.
If you find this plugin useful or have any question, please leave a comment right below 🙂 Thank you.
Updated 08 MArch 2014:
As I updated at Unity 5 I noticed and fixed a bug in the plugin: clicking the back button in Android the game shuts down. If you have the same problem just download it again and replace the “immersivemode.jar”.
Even if Unity 5 builds in Immersive Mode by default (so this plugin is obsolete now), I found that the Immersive Mode is activated after that the game has started, with a bit of delay, and if you are reading the resolution of the screen in Awake/Start function, it gets the value before the Immersive Mode, so it’s essentially wrong! But I guess it’s a small bug that will be fixed soon in a new release/patch.
Instead using my plugin, in the Awake/Start function you have the correct resolution of the screen in full Immersive Mode.
Walter 13 June 2022
The game script is in .json format. Would that be of any issue trying to view the source code using your app
Walter 8 April 2022
Im trying to view source code during game play any info would greatly be appreciated
tribio 8 April 2022 — Post Author
Hi Walter, this code is old, it might not work anymore.
The code you need is in this page, you need to add it to your own script.
EternityInAMoment 7 May 2019
Hello, I tried using the plugin according to steps in Xiaomi Redmi 6 pro. But its still not working. I want to use the safe area for On-Screen Abdroid buttons. But I can’t expand mu app to render in that area. I have to manually set it to full screen from settings. It works fine then. Is there a way to directly start app in full screen.
tribio 7 May 2019 — Post Author
Hi,
this plugin is meant to be for Unity5 and the code is quite old. I haven’t been updating it, so most likely something has changed.
I’m sorry but I can’t really help you here 🙁
Sofia 20 July 2016
thankz, plugged in help me !
yeandab 7 March 2016
Thank you
Dmitry 5 February 2015
Greetings from Russia, thank you. You saved us !!!
tribio 5 February 2015 — Post Author
Good! 🙂 Thank you!
tribio 7 January 2015 — Post Author
@Husky
Yeah! 🙂
Husky 7 January 2015
Wow, thank you, this plugin helps me a lot! 😀