Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

CanvasScaler.Update() causes slowdown according to Unity Profiler

Discussion in 'UGUI & TextMesh Pro' started by Ben-BearFish, Mar 10, 2015.

  1. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    I noticed while running my game in the editor with while using a CanvasScaler script on my UI Canvas, that the profiler attributes the spikes and slowdown to CanvasScaler.Update(), which inside calls Screen.get_dpi.

    I was wondering if it was possible to control how frequently the CanvasScaler.Update() is called, and if not, is there a way to create my own script that reproduces what the CanvasScaler does?
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,683
    The UT guys let slip that this is purely an editor thing and should not occur in builds. It's completely normal.
     
  3. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Ok. Does that mean I'm not able to have the game run smoothly in the editor because besides that everything else's millisecond amount is low in the editor.
     
  4. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,683
    If it's causing a concern for you, then I'd create a sample project and submit an issue using the Unity bug tracker. The above was just a statement they made on another post recently.