Making a menu with buttons

I’m currently creating a menu for my iOS game. My menu has 25 levels the player can select from - therefore, my idea was to draw 25 separate buttons. I’ve gotten the code working and placement of the buttons correct, but when I run the game and check the performance stats, it says that Unity is making 125 draw calls. I’ve of course heard that the fewer draw calls the better - is there a better way to implement a menu with lots of “level-select” buttons?. All help is greatly appreciated.

Note - I’m using several if-statements to draw my buttons (so 25 if-statements) - would it be better to use a for loop?

If you are using Unity GUI then that’s probably main reason for high draw call count and looping wont help much. Its pretty horrible for mobile games.

What is a better way of implementing a GUI menu without Unity’s GUI? I’m currently using several Unity GUIStyles for my buttons.

Most people use NGUI, UIToolkit, EZGUI etc. or made their own

Unity’s GUI system is not efficient for mobile because of all the draw calls. There are many GUI systems written by developers that make great effiecient systems for mobile GUIs (that combine all the buttons/GUI items into fewer draw calls). You should use one of these for iOS for sure. Ostwind suggested the main ones above. Check those out in the forums here or in the Asset Store.

If your menu is static with no background animations, I see no problem with tons of draw calls. Maybe only once you animate buttons to slide in and out of the screen. Overlaying tons of buttons on top of a running game is a different issue, where draw call count can impact fps.

If your frame rate is good and it’s just a menu, you should be fine.