Application manager

OK, as I mentioned, since this is our application or game manager when we get to the point of making this a game, we will need it to handle scoring and all the other elements that make a game a game.

So, first we will go in and delete what we no longer need. In the next series of screenshots in this section, all the highlighted text is what is being deleted.

For off, let's delete the bools that we will no longer need:

In our Start() function, delete the method call, as highlighted:

In the Update() function, delete everything that used the bool variables we have just deleted in the previous sections: 

Here is more of Update():

Finally, we need to get rid of this bool call in our SetSpatialMap() method:

With these out of the way, we now need to look at the additions. In this case though, as we go, we will talk about what they do:

As a manager object, AppManager needs to have a quick access to almost everything in a scene. Here, we are exposing three new GameObject to the editor so that AppManager can turn them on or off as needed.

Directly under our new Prefab GameObject comes the heart of this change. As I mentioned, we are using a switch to control the flow of everything.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.240.21