ApplicationManager
Okay, this class has become a bit of a monster, but we have built upon the changes we made previously using the enum and switch to make the process a bit smarter and to plan ahead to add things such as keeping score and setting throw limits, as well as other things.
With that in mind, the script is too large to go over every line, so grab the version in the Chapter9
downloads package and copy it to your current version. We will spend some time going over the core changes and additions in the next chapter.
Once you have the code copied and saved, the application manager will suddenly look a bit less unruly. One problem that can arise with writing code for Unity is protection levels. Public variables have a slightly different function in Unity than they do in plain C#.
Action makes sound
Now, before we get into the core of the new ApplicationManager
, we need to add another component to the AppManager
object.
While I like the atmospheric sounds that play when the game begins,...