Game Development Reference
In-Depth Information
Now we know where the Goblins are going to appear; we just need to get them there, so
we'll manage this with a BattleManager script.
The purpose of this script is to manage the life cycle of the battle scene, from setting up
the battle scene to taking turns to attack and finalizing the battle once complete.
We start off by creating a new BattleManager C# script and placing it at the top of the
project Assets folder along with the other managers (if you wish, you can create a sep-
arate Managers folder and organize them there). As this script only works when we are
in a battle, there is no need to make it a singleton. Battles come and go and they should
only last for the length of the current battle.
Note
For now, we will just set up the framework for the battle scene and get it populated. Our
poor hero has no chance to defend himself yet, so we'll just let him run away with his tail
firmly between his legs.
First, we'll add some variables that we can configure from the scene using the following
code:
Search WWH ::




Custom Search