Why should i use a Manager?

Hi,

I’m just getting into unity and i’m having trouble understanding the concept of gamemanager. I’ve watched some tutorials on UI and i’m a little bit confused as to what the GameManager does exactly. Basically people created the manager (An empty object) to link objects from script files with unity objects. But i can write a script and add it as a component to a button without the help of a manager. So why is the manager necessary?

Game managers are usefull for, as the name suggests, making the managing of your game easier.

If you’re talking about adding components to your game then no, you wouldn’t use it for that.
But if you want to handle say, the pausing of the game or tell objects that the game is in the end state or the player is respawing
the manager can store that information and make it easier for other objects in your game to get to it because it is all in one place.

Mainly they’re used for initialization, so for example some students of mine are working on a local multiplayer racing game and in the menus they select their car and level.
When the game loads the game manager reads that information, stored as a static variable, and isntantiates the car the player wanted then tells that car what it’s player number is so the
player that selected it is in controll of it.

Just keep making games and learning more about good programming (mainly Encapsulation) and it will become clear as to why having a gamemanger is a good idea.