I’m currently working on a arcade space shooter, in this game the player can choose different ships, every ship has different properties, some can be faster, some others can have more health, they all have different sprites sizes.
There’s a couple of attacks, single laser, double and triple, so for every ship there needs to be a configuration for each attack, as of now I structured my ship prefab like this
The parent has the collider, rigidbody and player script (which is an extension of the Ship script with the touch controls), the children are the configurations and the children of the configurations are the muzzles, which are the points from which the bullets should spawn.
The ship prefab can’t shoot, the different configs have a script that makes them shoot using the specified muzzles, this anyway is a little hard and messy to handle, whenever I pick up a powerup that powerup has a name with the config and inside the powerup script I have access to the Ship script so I disable all configs attacks and then enable the one hold by the powerup, when the powerup expires I simply disable all configs attacks and re-enable the Default one.
I was wondering if there’s a better way of doing this since the various config have 2 scripts: the one with the attack and the one that lets me get the muzzles, I can’t merge the two for reasons.
I already tried using ScriptableObjects but I ended up throwing them away because they didn’t really fit,any tips?