The problem is that the class Projectile apperatnly inherits from MonoBehaviour, MonoBehaviour is needed to provide the unity functions update, awake, onMouseOpen and is needed to be able to attach a script on a gameObject in the inspector.
You have two solutions:
You remove inheriting from MonoBehaviour in the Projectile class. This only works if Projectile don´t manipulate the world on anyway or use don´t use any GameObject functions.
You add the class Projectile to the GameObject in the inspector then you use the code
“projectileClass = gameObject.GetComponent(“Projectile”)” in the gun class Start() function.