Step 1:
Create an Icon:
Design your game icon. It should be representative of your game's theme, and easily recognizable even in smaller sizes. Make sure the icon has a transparent background and it saved in a suitable image format PNG.
Step 2:
Prepare Icon Variants:
Android devices come in various screen densities, so you need to provide multiple versions of your icon. Create different-sized variants of your icon to support different screen densities (ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi).
Step 3:
Import Icons into Unity:
Open your Unity project. Go to the Assets folder and create a new folder called "Icons." Import all the different-sized icon variants into this folder.
Step 4:
Set Icon Properties:
Select each icon variant in the Icons folder. In the Inspector window, you can adjust properties like Max Size and Format to optimize the icons for different devices. Ensure the Texture Type is set to Sprite (2D and UI).
Step 5:
Configure Player Settings:
Go to File -> Build Settings. In the Build Settings window, click on the "Player Settings" button. In the Player Settings Inspector, expand the Resolution and Presentation section. Here, you will find options like Default Icon and Adaptive Icon. Click on the small circle next to Default Icon and select the appropriate icon variant for each screen density. For Adaptive Icon, you can configure additional options like foreground and background layers if you want to create a more dynamic icon.
Step 6:
Test on Android Device:
Build and deploy your Unity game on an Android device to see how the icon appears on the home screen. Make sure the icon looks clear and well-defined on different screen sizes.