- EvelynFull-time IndieDev.I'm Japanese, so please forgive me if my English is strange.
Hello and welcome to Evelyn GameDev!!
In this article, I'll show you how to use Sprite Atlas to reduce the build size of your Unity game!
I hope you will read this article to the end, as it will help you to improve those problems.
I was able to reduce the app size in the AppStore from 377MB to 209MB by trying this method.(-44.5%)
This article will proceed as if it were a 3D project on 2020.3.11f1.
Table of Contents
If it is a 3D project, import the necessary package
If you are working on a 2D project, you don't need to go through this process, but if not, open the Package Manager and import the 2D Sprite.
Change the Project Setting
Next, you need to activate Sprite Atlas for your project.
Open the Project Setting and display the Editor tab.
Change the Mode of the Sprite Packer to something other than Disabled.
Creating a Sprite Atlas
Right-click and select Create > 2D > Sprite Atlas to create a new Sprite Atlas.
You can change various settings from the Inspector.
|Allow Rotation||Whether to allow Sprite rotation when packing|
|Tight Packing||Whether to pack the Sprite tightly or not|
|Padding||Padding between Sprites|
You will mainly want to change the above items.
It is recommended to turn off Tight Packing for icons used in the UI, as this will prevent other sprites from appearing in the corner.
Assign Sprites and click the Pack Preview button to see what the current Sprite Atlas looks like.
Summary of this article
Especially in AppStore and GooglePlay, it would be nice if the size of the application could be made as small as possible since it affects the completion of installation.
Also, Sprite Atlas can improve your game's performance, so use it aggressively!
- Reduce the size of the build file.
- Shorter loading time.
Thank you for reading to the end. I hope to see you again in another article.