Variables for different weapons: best practise?

Hi all

My situation: I have a class “Gun”. It has all the behavior etc for a gun. I have two more classes, pistol and shotgun, that both inherit from Gun, and have their own damage values, fire rates, etc.

Now, how should I be storing those variables? At first I had them as private variables and set them in the start method, but now I’m making them public and changing them in the Unity UI. It’s way more convenient this way, and it seems to be saving fine once I make prefabs of each weapon, but I just wanted to make sure that this is the best way to save variables for child objects?

It’s completely fine to use the inspector to change values in scripts like you’re doing. That’s what its there for, to make the configuration of game behavior easier and clearer.