Exemplo n.º 1
0
        protected virtual void DoShoot()
        {
            if (!cc.upperBodyInfo.IsName("Aiming Upperbody"))
            {
                return;
            }

            if (shootCountA > 0)
            {
                shootCountA--;
                shooterManager.Shoot(aimPosition, !isAiming, false);
            }
            if (shootCountB > 0)
            {
                shootCountB--;
                shooterManager.Shoot(aimPosition, !isAiming, true);
            }
        }
 protected virtual void HandleShot(vShooterWeapon weapon, GenericInput weaponInput, bool secundaryShot = false)
 {
     if (weapon.chargeWeapon)
     {
         if (weapon.ammoCount > 0 && weapon.powerCharge < 1 && weaponInput.GetButton())
         {
             weapon.powerCharge += Time.deltaTime * weapon.chargeSpeed;
         }
         else if ((weapon.powerCharge >= 1 && weapon.autoShotOnFinishCharge) || weaponInput.GetButtonUp() || (!weaponInput.GetButton() && isAiming && weapon.powerCharge > 0))
         {
             if (shooterManager.hipfireShot)
             {
                 aimTimming = 3f;
             }
             shooterManager.Shoot(aimPosition, !isAiming, secundaryShot);
             weapon.powerCharge = 0;
         }
         animator.SetFloat("PowerCharger", weapon.powerCharge);
     }
     else if (weapon.automaticWeapon ? weaponInput.GetButton() : weaponInput.GetButtonDown())
     {
         if (shooterManager.hipfireShot)
         {
             aimTimming = 3f;
         }
         shooterManager.Shoot(aimPosition, !isAiming, secundaryShot);
     }
     else if (weaponInput.GetButtonDown())
     {
         if (allowAttack == false)
         {
             if (shooterManager.hipfireShot)
             {
                 aimTimming = 1f;
             }
             shooterManager.Shoot(aimPosition, !isAiming, secundaryShot);
             allowAttack = true;
         }
     }
     else
     {
         allowAttack = false;
     }
 }