Hamburger Menu – Unity 3D
Create an easy and familiar pop out Hamburger Menu with zero coding. Simply drag in the prefabs, run some slight setup (see guide for instructions). Runs on iOS, Android, Windows Phone, PC and Mac (OSX).
For support please contact me.
To install, simply follow the following instructions:
- On the Unity editor window for your project, click Assets > Import Package > Custom Package.
- Navigate to the location you downloaded the Hamburger Menu package, select the package and click open.
- Inside your assets folder you should now have all the files for the Hamburger Menu.
There should now be a HamburgerMenu prefab:
- Add a UI Canvas object to your project and make sure that the scene’s main camera is pointing at your Canvas.
- Drag the HamburgerMenu prefab from the assets folder onto the Canvas Object, it should automatically position the MenuButton and MenuPanel to the left of the screen with the MenuPanel being out of view of the Main Camera – this is normal.
- Play the game and click the HamburgerButton, this should now show and hide the MenuPanel.
To add buttons to the menu, follow these steps:
- Select the MenuPanel and click the Add Component button in Unity Inspector, select Layout and select the required layout type – Horizontal, Vertical or Grid (More information on using these can be found at https://docs.unity3d.com/Manual/index.html)
- In the Hierachy, right click the MenuPanel > UI > Button. Add a button text or change the Source Image as required, if you have skipped Step 1 of this Adding Buttons guide then you will have to position the button manually using the Transform tool otherwise the Layout handler should position the button automatically.
- Setup the button to link/run whatever script you require (https://docs.unity3d.com/Manual/script-Button.html).
There may be some minor tweaks you may need to perform, depending on the size/position of your MenuPanel or MenuButton when the menu is showing, do tweak this do the following:
- Select the HamburgerMenu Gameobject in the Hierarchy and locate the Hamburger Menu (Script).
- Both the Menu Showing Position and Button Showing Position are editable and something you can experiment with in regards to positioning the MenuButton/Panel. By default these are set to the following
- Menu Showing Position = 9
- Button Showing Position = 3.3
The lower the number the closer to the left side of the screen the MenuButton and MenuPanel will be, if you require more of the panel to show increase the Menu Showing Position, additionally you will need to adjust the Button Showing Position too.
From time to time bugs appear, if this is the case please contact firstname.lastname@example.org and I will see if I can help you and again, thank you for buying this package.