Skip to content

Scripts.WeaponManager

Wesley Haws edited this page Jan 29, 2017 · 3 revisions

##Scripts - WeaponManager

###What does this do?


Controls the use and access to a dictionary of weapons for the player. It allows the player to scroll select weapons, fire them, feel the kick, eject shells from the weapon, reload them, etc. This is to be used in combination with the "Weapon" script.

###Who/What is this for?


This must be placed on the root gameobject of the player only. This will not function anywhere else.

###Setup


Parameter Type Description
Anim Animator The animator to send commands to and update the states
Anim Controllers Custom[] A list of weapon types and the controller name to place into the "Anim" parameter as runtime when that weapon type is selected. (NOTE: These Animator Controllers MUST be place in the "Resources" folder at the root of your Unity project!)
Kick Point MouseLook The mouselook script to manipulate the Y axis of to simulate a weapon kick when the weapon is fired.
Equipped Weapon bool (Debugging Only). The player currently has a weapon equipped or not.
Weapon Selection Custom[] Dictionary of weapons. Give a weapon name (This must match in "Weapon" script.), Weapon Gameobject held by the player(simply turns this object on or off), and the weapon type (Use to switch the animator at runtime.)
Hit Dictionary Custom[] Dictionary of items that will produce a desired particle effect. (Note: Supply only a "Material Name" or "Tag", NOT both). Visual = The particle effect to spawn when this item is hit. Visual Destory Delay = How long the visual will last before getting removed. Decal = A gameobject (Like a bullet hole), to place at the hit location. Decal Destroy Delay = How long the decal will remain before getting removed. "Sounds To Play" = List of sounds to randomly choose from and play one when this item is hit. Volume = How loud to play the sound
Scroll Select Speed float How fast the player is allowed to scroll through their weapons
Last Weapon GameObject Debugging only. Don't place anything here. Will show the last weapon held by the player.
Clone this wiki locally