Game Development Reference
In-Depth Information
The battle state manager
Starting back in our
Battle
scene, we need to replace our temporary state machine with a
proper one using all of Mecanim's handy features. Although we will still only be using a
fraction of the functionality with the RPG sample, I advise you to investigate and read
more about its capabilities.
Navigate to
Assets\Animation\Controllers
and create a new
Animator Con-
troller
called
BattleStateMachine
, and then we can begin putting together the
battle state machine. The following screenshot shows you the states, transitions, and prop-
erties that we will need:
As shown in the preceding screenshot, we have created eight states to control the flow of a
battle with two Boolean parameters to control its transition.
The transitions are defined as follows:
• From
Begin_Battle
to
Intro
◦ BattleReady = true (Transition Duration = 0)