0
\$\begingroup\$

I am trying to create a menu UI.

I have three menus, one main one that I want to display in the center of the screen and two smaller ones that will come out from the left and right respectively.

I am looking for elegant methods that won't bog down the game and enable me to display all three UI menus at will.

\$\endgroup\$
  • 1
    \$\begingroup\$ What have you tried? What specific symptoms of "bog down" have you observed based on this approach? It seems like just having the game objects present but inactive should work adequately - do you have profiling indicating that a more complex approach is required? \$\endgroup\$ – DMGregory Jun 29 at 13:07
0
\$\begingroup\$

Well the provided information is not enough but I'm gonna try my best... •If you don't want all three menus to appear all at once you can use somekind of a button to switch between the menus and then animate them to make the transition look good. •If you want them to appear all at once but after waiting for a while... You can animate them like: Make the main one appear then wait a second then the second one appears from the side of the screen then the third one.

Hope that's what you wanted....

\$\endgroup\$
0
\$\begingroup\$

I'm not sure to understand you question, but lets say I do. First, you should place all your UI elements from each menu as children of an empty GameObject that is child of the canvas, and do that for each scene. By default, lets say for the right scene, you place the Container GameObject on the right outside of the canvas / where the player cant see the UI. When youll try to switch to the right menu, use a DontDestroyOnLoad function to keep the visual elements of the middle scene, why you open the right scene (and remember the right scene UI is not visible yet). Then you use a simple transform.Translate in the Update to translate the Container GameObject of the right scene to the right, while you do the same with the middle scene GameObjects to get them out of the players view. Finally, you destroy the DontDestroyOnLoad gameObjects with a GameObject.Find function. I know this isn't clear, excuse my bad english :b

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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