Game Development Reference
In-Depth Information
7.
Drag the Sunflower into the Hierarchy view. (It should show up in the Game
view at the corner of the walkways.)
The draw calls go up to 47, and three are saved by batching. The Sunflower also uses two materials.
8.
Delete the Sunflower from the Hierarchy, and drag the CornStalk into it.
The draw calls go up to 48 and six are saved by batching. The CornStalk uses three materials. The
tassel at the top requires an alpha channel, but the CornStalk would probably be more efficient by
one draw call if the stalk and leaf materials had been atlased onto a single texture sheet.
9.
Stop Play mode.
The garden returns to the way it was. The Sunflower is gone, and the Raised Bed it once again
active in the scene.
So you've seen a bit of batching done on objects that use multiple materials, but so far, you've yet
to see any batching on the objects that share a single material. It turns out you need to mark the
objects as static before you will see any results. Static objects are objects that will not move in the
scene. There are several Unity features that can make use of this setting to improve performance,
and each can be handled separately if needed.
1.
Select the CornerGarden in the Hierarchy view.
2.
At the top right of the Inspector, check Static.
3.
Click “Yes, change children” in the dialog.
4.
Click the down arrow to see all of the features that were marked as Static
(Figure 4-20 ).
Figure 4-20. Marking the CornerGarden (and its children) as Static
Search WWH ::




Custom Search