Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

One script or Many for a weapon system?

$
0
0
I just started making a weapon system and I suddenly realized I had no clue where to begin. I know Inheritance stacking is very impractical, so composition is the way to go, but how do I go about it? I mean, should I write everything in one script and just select/deselect behavior from the editor, or should I write separate scripts?
To put it in perspective, imagine a pistol, a laser and a boomerang. All of these can be fired, but a boomerang can't be reloaded for example, and pistol ammo...

One script or Many for a weapon system?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>