Search Unity

Unity 2018.2.10f1 not correct resolution Android 9.0

Discussion in 'Android' started by AGaming, Aug 17, 2019.

  1. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103
    Good afternoon, I ran into a problem. On Android version 9.0. I can’t reduce the screen resolution for different devices. Due to the fact that the phone does not start the game in full screen mode, but with black bars at the edges. Screen resolution is always maximum. Which causes an increased load on phones of a lower level.

    An example script, it works fine on versions of Android 8.0 and below:

    Code (JavaScript):
    1. #pragma strict
    2.  
    3. var rez ;
    4.  
    5. rez=Screen.currentResolution.width + "x" + Screen.currentResolution.height;
    6.  
    7. if(rez=="2340x1080" ){
    8. Screen.SetResolution(1480, 720, true, 60);
    9. }
    10.  
    On Samsung phones there is a decision that must be made manually. Open the Game Launcher, go to "Full screen apps" - and remove the auto, instead we set it - full screen. Then the game restarts. And the script begins to see the screen resolution of the phone, after which it changes to the one I set.
     
  2. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103
    I understood why my script is not working. This is all due to the Android Render Outside Safe Area, and now the question is how to disable it on Unity 2018.2 versions ????????

    This is just hell !! Because of Screen.safeArea, a game on an average device starts up in a resolution of 2009x1080. How to chop it off !!!
     
    Last edited: Aug 19, 2019