Esempio n. 1
0
 public void PickUpWeapon(ShootBehaviour shootBehaviour)
 {
     playerShootBehavior = shootBehaviour;
     rbody.isKinematic   = true;
     this.col.enabled    = false;
     playerShootBehavior.AddWeapon(this);
     interactiveRadius.enabled = false;
     this.Pickable             = false;
     currentInventoryAmmoCount = playerShootBehavior.GetInventory().GetCurrentAmmo(weaponType) + mag;
     playerShootBehavior.GetInventory().AddAmmoToInventory(weaponType, mag);
 }
Esempio n. 2
0
 public bool StartReload()
 {
     currentInventoryAmmoCount = playerShootBehavior.GetInventory().GetCurrentAmmo(weaponType);
     if (mag == fullMag || currentInventoryAmmoCount == 0 || currentInventoryAmmoCount < fullMag)
     {
         return(false);
     }
     else if (currentInventoryAmmoCount < fullMag - mag)
     {
         mag += currentInventoryAmmoCount;
         currentInventoryAmmoCount = 0;
     }
     else
     {
         currentInventoryAmmoCount -= fullMag - mag;
         mag = fullMag;
     }
     WeaponAnimation?.Invoke(mag);
     return(true);
 }