Started Keybinds (1,2,3,4)

added: "Weapon1","Weapon2","Weapon3","Weapon4"
to InputManager and started implementing Keybinds for weapons
This commit is contained in:
Noah4ever
2021-12-01 19:42:18 +01:00
parent 64cadf0a35
commit c6e75ae3a8
9 changed files with 1073 additions and 1892 deletions

View File

@@ -25,12 +25,19 @@ public class WeaponManager : NetworkBehaviour
void Update() {
if (isLocalPlayer) {
if (Input.GetAxis("Mouse ScrollWheel") > 0f) { // Scroll up
if (Input.GetButtonDown("Weapon1")) {
currentWeaponIndex = 0;
}else if (Input.GetButtonDown("Weapon2")) {
currentWeaponIndex = 1;
}else if (Input.GetButtonDown("Weapon3")) {
currentWeaponIndex = 2;
}else if (Input.GetButtonDown("Weapon4")) {
currentWeaponIndex = 4;
}else if (Input.GetAxis("Mouse ScrollWheel") > 0f) { // Scroll up
lastWeaponIndex = currentWeaponIndex;
activeWeapons[currentWeaponIndex].SetActive(false);
switchWeapon(-1);
}
else if (Input.GetAxis("Mouse ScrollWheel") < 0f) { // Scroll down
}else if (Input.GetAxis("Mouse ScrollWheel") < 0f) { // Scroll down
lastWeaponIndex = currentWeaponIndex;
activeWeapons[currentWeaponIndex].SetActive(false);
switchWeapon(1);