Created
December 16, 2014 14:03
-
-
Save DaveVoyles/9dc2e4b2399d4acad7b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//<summary> | |
//Check for user input and switch weapons accordingly | |
//</summary> | |
private void CheckIfSwitchingWeapon() | |
{ | |
if (Input.GetButtonDown("SwitchWeapon")) | |
{ | |
NextWeapon(); | |
} | |
} | |
//<summary> | |
// Picks up the new weapon & adds it to inventory array, then sets it as active weapon | |
//</summary> | |
//<param name="weapon">Which weapon should we add to the inventory?</param> | |
public void PickupWeapon(int weapon) | |
{ | |
weaponInventory[weapon] = true; | |
SwitchToWeapon(weapon); | |
currentWeaponIndex = weapon; | |
print("Current weapon pick up is: " + weapon); | |
} | |
/// <summary> | |
/// Switches to weapon when the player picks it up | |
/// </summary> | |
/// <param name="weapon">Which weapon did we just pickup?</param> | |
public void SwitchToWeapon(int weapon) | |
{ | |
if (weaponInventory[weapon]) | |
{ | |
// animate putting currentWeapon away | |
BulletPreset = (BulletPresetType)weapon; | |
// animate pulling out currentWeapon | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment