Creating Manager Classes in Unity

The Game Manager

Game Manager

I have been using using a Game Manager Object to Play the cut scenes when a game event happens. It is time to make this a little more convenient for use to use and more organized.

First I am going to need a Class that can play a cut scene when the game event is triggered.

Now I have the logic in place it is time to fill out the method.

Next I removed all of the Unity Event Listeners from the Game Manager Object and added the Game Manager Component and added the Game Manager Class.

Next I added the logic to the Game Manager Behavior.

I created a Cut Scene Game Event Listener for all of My Cutscenes, made sure they where all initialized, made sure that the On Enable and On Disable is taken care of. I then added my custom logic for the cut scenes that need it. The Completed Level Cut Scene should only play if the player has gotten the key card which happens when the Sleeping Guard Cut Scene plays. Also the key card should no longer be visible on the guard after the Sleeping Guard Cut Scene plays.

Now all I have to do is assign the values in the inspector