Manager Classes in Unity: A Simpler Way to Call variables(Game Dev Day 64)

Jack Leavey
Jan 20, 2022

Manager class objects are commonly used to manage different functions in gameplay. In this project, I used two; one controls the audio for the game and the other is used to end the introduction cutscene and allow the player control following the end of that cutscene.

These scripts follow a pattern known as a singleton (more on that in another article).

The Entire GameManager script.

Manager classes can become a dumping pit of sorts, taking in variables and values that did not fit in other places and make them available to reference to a wide variety of other scripts.

This eliminates the need for GetComponent to be used in reference to the object the component is on over and over again!

--

--

Jack Leavey

I am a software engineer with years of experience branching into game development, specifically in Unity. Follow along for guides on creating game mechanics!