Weapons manager
I'm making a game where I want the same weapons-model to stay, even when I switch weapons. Therefore, I want to make a weaponsmanager, where I can manage what weapons are active and which arent. I also want to easily be able to add new weapons.
I was thinking about making a weapon class script, with name, firerate, damage etc. and then making a list where I can extend the list (in the inspector) and add a new weapon. Would that be an efficient way? or is there a better way?
Answer by tormentoarmagedoom · Jun 26, 2018 at 10:27 AM
Good day.
IF all weapons will do the same, only changing int/float values like range, damage, cooldown... Yes, the best solution is to create a general weapon script, so you can easy acces its variables from anywhere.
And if some weapon have a special power (for example freeze, push, etc...) you can create a aditional script called something like "WeaponPower".
Bye :D
Your answer
Follow this Question
Related Questions
Weapons Manager 1 Answer
Storing diffrent bullet amounts for different Weapons. 1 Answer
Using constructors in Unity (C#) 8 Answers
(SOLVED) Accessing (string) arrays by enumerations from another class 0 Answers
Access scripts on Awake or Start? 1 Answer