Quick Question on how to write a player class
Hello everyone, I'm currently trying to write the player class for my game, and I'm wondering which aspects of the player should be kept private, and which ones should be kept public, as in stuff like player name, player health, player xp, mana, money count, etc. And if some of these are private, should I use public or private getters and setters? Thanks in advance!
Answer by TheFish657 · Jul 17, 2016 at 01:07 PM
Just think whether you will need to access it from another script, just remember that you can use [SerializeInInspector] or @SerializeInInspector to show it in the inspector and [HideInInspector] or @HideInInspector to hide it
Your answer
Follow this Question
Related Questions
public vs private array in classes 0 Answers
hide object with mouse enter 0 Answers
How to disable raycast/groundchecker on OnTriggerEnter? 0 Answers
performance question about public variables vs. private variables 1 Answer
Need help with two scrips 0 Answers