Exemplo n.º 1
0
    protected virtual void ShotInput()
    {
        var weapon = shooterManager.rWeapon ? shooterManager.rWeapon : shooterManager.lWeapon;

        if (!shooterManager || weapon == null || cc.isDead)
        {
            return;
        }

        if ((isAiming && !shooterManager.hipfireShot || shooterManager.hipfireShot) && !shooterManager.isShooting && aimConditions && !isReloading && !isAttacking)
        {
            HandleShot(weapon, shotInput);
            if (weapon.secundaryWeapon)
            {
                HandleShot(weapon.secundaryWeapon, secundaryShotInput, true);
            }
        }
        else if (!isAiming)
        {
            if (weapon.chargeWeapon && weapon.powerCharge != 0)
            {
                weapon.powerCharge = 0;
            }
            if (weapon.secundaryWeapon != null && weapon.secundaryWeapon.chargeWeapon && weapon.secundaryWeapon.powerCharge != 0)
            {
                weapon.secundaryWeapon.powerCharge = 0;
            }
        }
        shooterManager.UpdateShotTime();
    }
Exemplo n.º 2
0
    protected virtual void ShotInput()
    {
        if (!shooterManager || shooterManager.rWeapon == null)
        {
            return;
        }

        if ((isAiming && !shooterManager.hipfireShot || shooterManager.hipfireShot) && !shooterManager.isShooting && aimConditions && !isReloading && !isAttacking)
        {
            if (shooterManager.rWeapon.automaticWeapon ? shotInput.GetButton() : shotInput.GetButtonDown())
            {
                if (shooterManager.hipfireShot)
                {
                    aimTimming = 3f;
                }
                shooterManager.Shoot(aimPosition, !isAiming);
            }
            else if (shotInput.GetButtonDown())
            {
                if (allowAttack == false)
                {
                    if (shooterManager.hipfireShot)
                    {
                        aimTimming = 1f;
                    }
                    shooterManager.Shoot(aimPosition, !isAiming);
                    allowAttack = true;
                }
            }
            else
            {
                allowAttack = false;
            }
        }
        shooterManager.UpdateShotTime();
    }