I have a weapon. This wepaon consists of different interchangable parts. The player can choose whether it should do fire, ice or poison damage, its attack speed and so on. The player can also choose which type of projectile behaviour to use from a total pool of 9 projectile behaviours.
For instance one projectile behaviour makes it so the projectile flies straight, another one so that it flies in a curve, or is not affected by gravity at all.
Now, in an ideal world I would like to code classes for all of those behaviours and modifications and at the end, have everything come together in a weapon class where a weapon is build based on type of damage, the attack speed and the projectile behaveiours chosen by the player.
My problem: I don’t see another way to code these projectile behaviours other than through an update() function. So my ideal structure of my weapon falls apart, because the projectile behaviour can’t be precoded in a class that will be attached to the Weapon MonoBehaviour. Am I wrong?
If I want to have the choice of all these projectile behaviours, is the only possible solution to hard code them inside the Update() function of my base MonoBehaviour Weapon class with if or switch statements?