After upgrading to ngui3, the number of drawcalls increased from 5 to 17 to 8. It should not be ngui. Later, I sorted out two points:
1. For the same Atlas, the number of drawcalls depends on the number of panels (actually the number of uipanel scripts ). For example, I have two sprite instances. The two sprite instances belong to the same Atlas but are located in different panels. In this case, the number of drawcall is 2, while that of ngui 2 is 1. We recommend that you use only one panel.
2. For sprite under the same panel of different Atlas, you can adjust the display level through depth. The Z value is useless, which is exactly the opposite of ngui 2. In addition, the depth values of Sprite of different atlas should not be interspersed back and forth. For example, in Atlas A, there are two sprite A and AA, and depth is 1 and 3, respectively. In Atlas B, there are two sprite B and BB, and depth is 2 and 4, respectively, then the total number of drawcall is 4 rather than 2. (In ngui 3, you can click panel to view the call details of each drawcall In the Inspector panel)
Simply put, the number of drawcalls is not only related to the number of Atlas, but also to the Atlas call sequence. It is best to use only one panel when using it. Sprite depth of different atlas should not be interspersed as much as possible.
Note: It is best to put the same panel in the same Atlas.