예제 #1
0
        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();
        }
예제 #2
0
 public void AddWeapon(Weapon.Weapon weapon)
 {
     weapons.Add(weapon);
     CurrentWeapon = weapon;
     NotifyWeaponChanged?.Invoke();
 }