public void SetDefaultWeapon() { _backpack.Add(Weapon.CreatePistol()); currentWeapon = _backpack[0]; Shooting.SetCurrentWeapon(); PlayerWeaponSwitch.SetCurrentWeapon(); HUD.SetCurrentWeapon(); }
public static void PreviousWeapon() { int i = _currentWeaponIndex - 1; if (i >= 0) { currentWeapon = _backpack[i]; Shooting.SetCurrentWeapon(); PlayerWeaponSwitch.SetCurrentWeapon(); HUD.SetCurrentWeapon(); HUD.UpdateWeaponDisplay(); _currentWeaponIndex = i; } }
public static void NextWeapon() { int i = _currentWeaponIndex + 1; int lastPossibleIndex = _backpack.Count; if (i <= lastPossibleIndex - 1) { if (_backpack[i] != null) { currentWeapon = _backpack[i]; Shooting.SetCurrentWeapon(); PlayerWeaponSwitch.SetCurrentWeapon(); HUD.SetCurrentWeapon(); HUD.UpdateWeaponDisplay(); _currentWeaponIndex = i; } } }