I’ve been going through Unity Learn Premium and have learned so much about C# with this. Very useful. I’m making a mobile game where the player has lives, number of tries per level allowed, score per level, and an inventory of small boosters.
I’m trying to understand how this needs to be organized. Right now I have the player controller script only handle the movement of the player. I also created a Game Manager script that does simple things like start the game, restart the game, move the camera forward, etc.
Where do these player stats and inventory levels fit in to my code? Do I create another class in my Player Controller script or should stats & inventory be managed separate like the Game Manager?
Since it’s a single player game right now, I can create a PlayerStats class within the PlayerController, create an instance of PlayerStats and assign those values. But it’s not like I need to create multiple instances of lives, tries, and scores.
If I eventually upload this to the app store, I would like to manage and display a leaderboard with other players scores. From a high level perspective, how should individual stats / inventory levels from each player be organized, especially if I plan to store the inventory levels & scores of anyone who downloads and plays this game?
Can I use properties in the game manager and get and set these values there?