Search Unity

Display.getRealMetrics and Display.getRotation

Discussion in 'Android' started by JoshOClock, May 13, 2014.

  1. JoshOClock

    JoshOClock

    Joined:
    Dec 8, 2010
    Posts:
    107
    While running my game I took a capture using Android Debug Monitor.

    I see this:
    $monitor.png

    All the Display.XXX calls seem like they might be taking up more of the frame than they should.

    My game doesn't change rotation so Display.getRotation seems unnecessary. It's set to Landscape Left only. And getWidth is a bit troublesome too. I guess for Unity to render it needs to constantly call these?

    Or is there something I'm doing to cause this?

    I looked through the code to see if I was maybe checking Screen.orientation or Screen.width every frame. But didn't see anything.

    Any help is appreciated.