Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by xxxmrfunxxx · Jul 13, 2013 at 08:53 PM · scenemobile

Main Menu: Is it better to subdivide it into different scenes?

I'm making a MOBILE game and I'm worried about performance. I want the game to look good with transition effects and such, but I don't know if making all the submenus in the same scene as the main menu is worth it. Are there any tricks for making this happen? Or is it better to just make them in separate scenes?

Thanks in advance. :)

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image create3dgames · Jul 14, 2013 at 12:03 AM 0
Share

You could have an enum with the different submenus and then use switch/case to put the gui.

avatar image Benproductions1 · Jul 14, 2013 at 03:10 AM 0
Share

If you make them different scenes, you will limit your options when it comes to transitions, you will clog up your build scene list and you will have massive (exaggerated) loading times between menus.
Remember that it is just a main menu. You're not going to have any fancy expensive physics or gameplay scripts running.
There is such a thing as "Over Optimizing"

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by IR Nifty · Jul 14, 2013 at 03:39 AM

It depends on how your menu is set up. The system I use is an enumeration depicting all the different menus, like main, options, graphics, sound, etc. and a simple switch in OnGUI to render each menu only if it is active. This I find is incredibly light on performance. I get over 600 FPS with it and there are still a few models and particle systems in the background.

I can give you a simple example:

 enum Menu = {Main, Options, Graphics, Sound}
 Menu currentMenu = Menu.Main;
 
 void OnGUI ()
 {
     switch (currentMenu)
     {
         case Menu.Main:
             RenderMain ();
             break;
         case Menu.Options:
             RenderOptions ();
             break;
         case Menu.Graphics:
             RenderGraphics ();
             break;
         case Menu.Sound:
             RenderSound ();
             break;
     }
 }
 
 void RenderMain ()
 {
     //Build your main menu here.

     if (/*options button is clicked*/)
     {
         currentMenu = Menu.Options;
     }
 }
 
 void RenderOptions ()
 {
     //Build your options menu here.
 }
 
 etc. etc.

So in each Render___ method, you simply build your menu in code, set the buttons to change the enum, and it will automatically change the menu!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jjmontes · Apr 19, 2014 at 02:35 AM 1
Share

Or ins$$anonymous$$d of using if/switch statements, you can keep several GameObjects or Components with the menus and enable/disable them on demand.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Top down house Help 2 Answers

NullReferenceExeption: Object reference not set to an instance of an object. 1 Answer

Needing help with mobile multiplayer. 2 Answers

OnMouseDown Range Problem 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges