-
Notifications
You must be signed in to change notification settings - Fork 23
Scripts.WeaponManager
##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. |
The following is a list of github repositories that made all of this possible:
delta patches: https://github.com/OctopusDeploy/Octodiff
.net 4 implemented in Monodevelop: https://github.com/mono/mono
Tuples In Unity: https://gist.github.com/michaelbartnett/5652076
Octodiff: https://github.com/OctopusDeploy/Octodiff
Input Manager: https://github.com/daemon3000/InputManager