3D Digital Artist & Unity Developer

Free Immersive Mode for Android in Unity

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!!!

Immersive Mode for Unity On Google Play

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/

Immersive Mode PlugIn

Zip File

If you have already your own Manifest.xml you just need to update the following line:

android-manifestIf 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.

Next Post

Previous Post

6 Comments

  1. Sofia 20 July 2016

    thankz, plugged in help me !

  2. yeandab 7 March 2016

    Thank you

  3. Dmitry 5 February 2015

    Greetings from Russia, thank you. You saved us !!!

  4. tribio 7 January 2015 — Post Author

    @Husky
    Yeah! 🙂

  5. Husky 7 January 2015

    Wow, thank you, this plugin helps me a lot! 😀

Leave a Reply

*

© 2017 Daniele Olivieri

Theme by Anders Norén