Пример #1
0
    public void ClearReload()
    {
        BulletLeftInMagazine.SetValue(GetCurrentMagazineCapacity());

        ReloadingMagazineTimer?.EndCounting();
        BoltReloadCycleTimer?.EndCounting();

        IsReloadingMagazine.SetValue(false);
        IsBoltReloadCycle.SetValue(false);
    }
Пример #2
0
    public void Shoot()
    {
        if (IsReloadingMagazine.Value == false && IsBoltReloadCycle.Value == false)
        {
            EjectBullet();
            BulletLeftInMagazine.RemoveValue(1);

            if (BulletLeftInMagazine.Value == 0)
            {
                ReloadingMagazineTimer.StartCounting();
                IsReloadingMagazine.SetValue(true);
            }
            else
            {
                BoltReloadCycleTimer.StartCounting();
                IsBoltReloadCycle.SetValue(true);
            }
        }
    }
Пример #3
0
 private void FinishReloading()
 {
     IsReloadingMagazine.SetValue(false);
     BulletLeftInMagazine.SetValue(GetCurrentMagazineCapacity());
 }