Lightmapping

There are two types of lighting systems in Unity: real-time or precomputed which can be used in combination. Whenever possible, it's best to eliminate dynamic lighting and real-time shadows and incorporate precomputed baked lighting. See the Unity guide to Lighting and Rendering https://unity3d.com/learn/tutorials/modules/beginner/graphics/lighting-and-rendering, for more information: https://unity3d.com/learn/tutorials/topics/graphics/introduction-lighting-and-rendering.

Although our small scene will not need any optimization, this is a step that should be considered on all projects:

Figure 5.7: Walking animation from Zombie GameObject

Let's get back to the project. Our next step is to create a zombie prefab and a system to control the zombie's behavior. The asset we downloaded has five different animations: walking, attacking, and the three dying animations (falling back, falling right, and falling left).We'll need a method for calling those animations when specific events occur. To do that, we'll use the Animator Controller.

The Animator Controller is a state machine. Like a flowchart, this state machine illustrates how various animations are linked to different actions. A state refers to the action a GameObject is currently engaged in: things like walking, jumping, or running. The state machine makes it easier to keep track of the actions and their associated variables, and creates a mechanism for transitioning from one state to another.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.230.172