Adding a main menu
The main menu UI resides under the Menu UI panel (under UI Canvas) in the scene hierarchy. We will add a menu panel with three buttons to let you add a cube, a sphere, and a virus. We'll create a menu sub-panel and arrange the menu buttons horizontally. Follow these steps:
- In the Hierarchy, unfold the UI Canvas, and unfold its child Main UI object.
- First, remove the temporary Main mode text element. Right-click the child Text object and select Delete.
- Right-click the Menu UI and select UI | Panel, then rename it
Main Menu
. - On the Main Menu panel, use the Anchor Presets to set Bottom-Stretch, and use Shift + Alt + click Bottom-Stretch to make a bottom panel. Then set Rect Transform | Height to
175
. - I set my background Image | Color to opaque white with Alpha:
255
. - Select Add Component, search
layout
, then select | Horizontal Layout Group. - On the Horizontal Layout Group component check the Control Child Size | Width and Height checkboxes...