(UNITY3d android game) When i don't touch the screen, my fps are lower than when i touch -
i've had problem long time smooth camera on mobile phone (platformer game), reported game works when fps don't drop below 60. notice fps fine when touch screen, when don't it, fps drop approximately 58, 59 , after camera don't follow player smoothly. testing create new scene fpscounter script , effects same. me it? think engine settings reasons, can't handle it.emphasized text
//--------------------------------------------- // variables //--------------------------------------------- private float deltatime = 0.0f; //--------------------------------------------- // methods superclass //--------------------------------------------- void update() { deltatime += (time.deltatime - deltatime) * 0.1f; } void ongui() { guistyle style = new guistyle(); float x = screen.width - 110; float fps = 1.0f / deltatime; rect rect = new rect(x, 90, 100, 50); style.fontsize = 18; style.normal.textcolor = getcolor(fps); string text = string.format("{0:0,0.0000 fps}",fps); gui.label(rect, text, style); } //--------------------------------------------- // class logic //--------------------------------------------- private color getcolor(float fps) { if (fps >= 60) { return color.yellow; } return color.red; }
have tried using new ui system introduced in unity 4.6? maybe fixes issues. https://www.youtube.com/watch?v=eox6itcukoc
Comments
Post a Comment