Author Topic: UIRect.Update() does a draw call per UILabel. Is that correct?  (Read 2060 times)

Vicas

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 8
    • View Profile
Hello.

I am having trouble understanding the basics of Unity and draw call knowledge. At first I basically made one UIPanel every time I put a new UILabel some where. Then I saw in the Profiler that this caused one draw call per UILabel. Stupid I thought, and then went on to batch most of my UILabels into the same UIPanel as I would imagine was really as intended.

That worked fine and I got my ~117 draw calls from UIPanel down to ~10. But now all my UIPanels are doing the 117 draw calls from UIRect.Update()! Is this working as intended?



Is there a way to batch this like I did UIPanel?

Regards,

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: UIRect.Update() does a draw call per UILabel. Is that correct?
« Reply #1 on: August 28, 2014, 04:01:32 PM »
You are confusing Draw Call with Method Call, the latter is the one referenced there. UILabels are batched as normal per material per panel like all other widgets.