Closed flip40 closed 7 years ago
Both options seems reasonable at the moment, but in the longer term option A sounds more convenient. If we start having a larger list of weapons, I imagine the Weapon script would get convoluted and so would the editor configurations. The GetComponent
Yeah, lets do A. I was concerned for a second as I had just realized I don't actually know how we would get a weapon by GetComponent without using the super class... And according to Google, wherever it was that I heard that you couldn't GetComponent
If we want to add features to weapons, should we either:
A: Use separate scripts for each weapon type (using inheritance to avoid copy-pasta).
Pros
Cons
GetComponent does NOT work. Considering we use Weapons as prefabs, this may not be an issue, but if we ever need to use that function, it will not work in the abstract. B: Use a single script with options (similar to how EnemyMovement works).
Pros
No issues with GetComponent due to being contained in a single script. Cons