public void ChangeWeapon() { if (weapons.Count == 0) { return; } var index = weapons.IndexOf(CurrentWeapon); if (index + 1 < weapons.Count) { CurrentWeapon = weapons[index + 1]; NotifyWeaponChanged?.Invoke(); return; } CurrentWeapon = weapons[0]; NotifyWeaponChanged?.Invoke(); }
public void AddWeapon(Weapon.Weapon weapon) { weapons.Add(weapon); CurrentWeapon = weapon; NotifyWeaponChanged?.Invoke(); }