Optimizing using sprite packing
Right now, when running the game, Unity will perform a separate draw call for every unique texture or sprite on screen at the time. A draw call refers to a step or process cycle that Unity must run through to correctly display a graphic on-screen, such as a mesh, material, or texture. Draw calls represent a computational expense, and so it's a good idea to reduce them wherever possible.
For 2D games, we can reduce draw calls by batching together related textures, such as all the props for a scene, all the enemies, or all the weapons. By indicating to Unity that a group of textures belong together, Unity can perform internal optimizations that increase render performance. Unity will add all related textures to a single internal texture that it uses instead. To achieve this optimization, follow these steps:
- Select all prop textures: Player, House, Platform, and Gem. These textures are all featured in the Project panel, though not all are...