Game Development Reference
In-Depth Information
Figure 6-3.
Adding the punch sprite frames into the scene; preparing to create a punch weapon prefab
Now parent all frame objects under a new, empty game object (
Weapon_Punch
). To this object, add
the
SpriteShowAnimator
component and define the animation as shown in Figure
6-4
. I've specified
a
Playback Type
of loop for now, simply for testing purposes to observe the sprite animation in the
Scene viewport, playing back endlessly as opposed to just once. For the final weapon prefab, the
playback type will be set to
PlayOnce
, since an animation should play only once for each attack.
Give this configuration a test to see the animation in action.