Mecanim
Now that we have two animated rectangles, we will take a quick look at Mecanim. Mecanim is a state machine-based controller for playing animations or clips. Without getting too deep into this heavily complex animation solution, we can say that this allows us to change an object's animation with simple variables.
For instance, a character can have a speed parameter. This parameter can be set up in our code to be changed based on how far the player pushes up on the game controller. Let's imagine that the speed variable is from 0 to 10. We also have three animations: standing still, walking, and running. If the user is not pushing the game controller up at all, the variable is 0; if they are halfway, then 5; if they are all the way, then 10.
The Mecanim window
Let's take a quick overview of the Mecanim or Animator view. In order to see our Animator view, we need to click on the Window
menu item and click on the Animator
option; as shown in the following screenshot.
First, you will notice...