Hello everybody,
Recently I have been trying to perform some UI optimization for a game. The game includes a list of characters, all organized in a Grid View Layout.
For each available character, I instantiate a prefab and place it on the Grid Layout Group. The prefab contains some UI pieces, but it is basically divided in 4 layers. I made an awful sketch of what I mean (Click here)
The drawing order is cell by cell (as expected by the Grid Layout). But my draw calls count suffer from it.
This means it draws the layers like 1 2 3 4 1 2 3 4 1 2 3 4 …
What I want, is to get the drawing order to be 1 1 … 1 1 2 2 … 2 2 3 3 … 3 3 4 4 … 4 4
That way I could batch each group together in a single draw call.
Is there any known way to achieve this?
I was thinking about using different Grid Layout Groups for each layer, but I am just wondering if there is a better solution.