- Home /
C# | public variables in parent class should not show up in child class
As the title says I have a parent class "Main" and I have several public variables. Now I would like to know if there is any way that these variables dont also show up as public variables in the inspector in the child classes. It would be so much more clear.
Thank you very much in advance!
Why did you make them public in the first place if you don't want people to see them?
Well because otherwise one can't see them in the Inspector, can they? This is a project for university and we're .. erh .. studying $$anonymous$$mwork. So it's basically like that: I "programm" the scripts and another person uses these scripts, so variables which can be assigned in the inspector are quite nice. And now I have a child class and of course there are also these public variables which show up in the inspector. (from the parent class)
Answer by Landern · Jun 02, 2015 at 10:32 PM
Either decorate them as HideInInspector or change the member access modifier to protected.