Exercises

Our Scene needs a lot of love to reduce triangle counts and draw calls and to be optimized. Start by looking at our Screen1 group and GameObjects, and try to find areas where you can reduce some of these counts.

1. Try removing the colliders attached to the sprites and create a single collider that encompasses them all. Maybe use an Edge Collider that has only two points instead of a Box Collider with four.

2. Try to locate where all of the draw calls originate. Are there ways to optimize some of them and reduce the total number? Does the problem lie in the Sorting Layers?

3. Do this throughout the Scene, looking for areas that could be improved. Remember that you can always hop over to the Game View (even without running it) to see ...

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.