Graphics Reference
In-Depth Information
6 Weapon Systems
The weapon system, or more specifically at this point, the firing system, needs to be capa-
ble of dealing with either single or multiple weapons. To be as flexible as possible, we
will build a weapon management system that will control individual weapon controllers.
Those weapon controllers, in turn, will deal with spawning projectiles, and finally, projec-
tiles will take care of themselves independently. Our weapon management system should
function with a single weapon, or we should be able to add many different weapons and
switch between them.
Our parent system should work independently of each specific weapon and fire out a
generic message to the currently selected one. The selected weapon will deal with the call
itself, and the overall weapon management system can continue unaffected.
The weapon controller deals with how weapons are stored or manipulated and passes
on messages to the actual weapons themselves. It contains an array containing all weap-
ons and a method to activate and deactivate them as required (switching between them).
Each weapon is a prefab with a script attached that derives from BaseWeaponScript.
cs. The weapon should be self-contained except when it receives a call to Fire() in which
it should do whatever it is supposed to do. BaseWeaponScript contains the basics for a
weapon (ammunition, reload time, and the ability to be disabled or enabled).
Search WWH ::




Custom Search