Game Development Reference
In-Depth Information
Figure 5-17.
Using the Animator window to control animation logic
Note
Personally, I'm not entirely convinced the term
Animator
is appropriate for this editor. It's not wholly
descriptive of what it actually does. Specifically, it's a node editor and a form of visual programming that's
concerned with wiring-up animation sequences into a logical arrangement to control their playback under
specific conditions. I think that
animation dynamics
or
animation nodes
would be more descriptive names.
But anyway,
Animator
is the name currently assigned to the editor by Unity Technologies; and I'll use this
name throughout the rest of the topic, where applicable.
To control the logic for camera animation I've added two states: a
default
state, with no associated
animation clip, that transitions into the
death
animation state, associated with the CameraDeath
animation clip. The transition between the default and death state is controlled by a Death trigger
parameter. This means that when the Death trigger is set to true, the camera death animation will
play (see Figure
5-18
). For this trigger to fire, a script must be used.