Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

We are developing a game in Unity 4.6.6 for both Android and iOS.

Currently I am building the game UI with the new Unity UI system. In particular I am building a button list to create kind of inventory slots using the Grid Layout.

I have noticed that my draw call count is increasing considerably despite having my UI in an atlas (using Sprite packer) and using the same font all over the UI. After some tests I noticed that one draw call is generated per each UI Text and UI image present in the scene composing each button when using a Grid Layout Group, when the Grid Layout is not used the draw calls are reduced noticeably.

7 elements without Grid Layout, results in 2 draw calls: (Screenshots taken in play mode) enter image description here

7 elements WITH Grid Layout, resulting in 14 draw calls: (Screenshots taken in play mode) enter image description here

I have no idea if it is possible to reduce the number of draw calls when using the Grid Layouts.

share|improve this question

1 Answer 1

Without code to reference the only thing I can assume is that the grid is adding another object to each button. Each button is one call, so 7, and the only reasonable assumption is that the layout is adding an additional call to each, now totaling 14.

From what it looks like, you're forcing height and width bounds and spacing is either assigned or being split between them all. 2 passes on each button versus whatever you where using in the first screenshot.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.