There is no standard Unity way to create a top bar like the native Android. You have to create a similar UI that looks that the Android menu with the components Unity's UI system This can easily be done if you know the basics of Unity's UI system.
Breaking down the Android menu for Unity:
The three dots can just be represented with the Image
or RawImage
component. If you decided to have 3 images(one for each dot) instead
of one image with three dots then use the VerticalLayoutGroup
to group all dots into one.
The search icon could just be a UI Button, Image
or RawImage
component.It really doesn't matter. Any of these should work.
You will need a grey background image just the color from the Android
Menu Item. Again, this image will also use the Image
or RawImage
component.
You will also need a Text
component to show your "Action Buttons" text or any or text you wish to display in the menu.
Finally, group all the components mentioned above into a panel then
use anchor and pivot point to position the panel to the top of the screen.
If you still want to show the Android menu, it is still possible to do:
- Create new Android project with Android Studio (Not from Unity. From there, create the
Android menu item.
- Export your Unity project and import it into your Android
project in Android Studio.
- Modify your Manifest and Activity class code to display your Unity
game as sub-view. You can find more information here. From there
you can even call Unity's function from your Android project with the
UnityPlayer.UnitySendMessage
function if needed. Your game will run with any Android UI.
I don't recommend this because it would only work on Android. Also, each time you make changes to your game, you would have to export it again. This is annoying and time consuming. Use the Unity UI system to create this.