예제 #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 FinishBoltCycle()
 {
     IsBoltReloadCycle.SetValue(false);
 }