-
Notifications
You must be signed in to change notification settings - Fork 0
Optimization tips
Nate River edited this page Mar 20, 2021
·
21 revisions
- At first, make sure that
Assets\HeroEditor\FantasyHeroes\Atlases\Sprites.spriteatlas
is set Include in Build (the same for Military Heroes and other). Then make sure that Sprite Packer is enabled (navigate toEdit/Project Settings/Editor
). - If you're using icons, also Include in Build
Icons
atlas. - If you're using Megapack, Include in Build only the atlases that you need.
- To optimize your build size simply remove unused sprites. You can delete unused sprites or you can disable default atlases (set
IncludeInBuild=False
) and create custom atlases that will include only sprites that you need. Alternatively, you can create a new custom atlas from code using SpriteAtlas API based on the list of sprites used. - It may be very useful to analyze Editor Logs after building a project to check the size of all resources packed. You can discover all unused but packed resoures here.
- Also don't forget to check Profiler inside Unity!
What may be the final size of the asset in your builds? Well, for example, all sprites from Fantay Heroes packed to atlases will take about 30-40 Mb of your APK on Android. BUT these atlases will take about 300Mb of a device RAM when loaded into memory. This may be an issue for old devices.
More info: